Commit 52fd1079 authored by ggaren's avatar ggaren

WebCore:

        Reviewed by Maciej, Anders, Darin.

        Removed the Page bridge. Beefed up Chrome. Added Screen and ScreenClient.
        Fixed a minor where WebCore would always assume it was displayed on the 
        monitor containing the menubar. window.open and window.showModalDialog 
        are now cross-platform. 
        
        Layout tests, manual-tests/show-modal-dialog, and manual-tests/
        window-open-features-parsing all pass. I verified the new screen functionality
        by running in DRT, and checking whether WebCore knew it was off-screen.
        
        Some refactoring remains, as all were not pleased by this design. I see
        in my future another patch.

        * bindings/js/kjs_window.cpp: Screen is now a stand-alone object with a
        client, to encapsulate asking the platform questions about the screen occupied by
        the page. (Previously, we always assumed we were on screen 0, which was a bug.)
        * bridge/mac/WebCoreFrameBridge.mm:
        (createMouseEventFromDraggingInfo): Reversed argument order, to match other
        functions.
        (-[WebCoreFrameBridge dragSourceMovedTo:]): ditto
        (-[WebCoreFrameBridge dragSourceEndedAt:operation:]): ditto
        * bridge/mac/WebCoreFrameNamespaces.h: Removed. Dead Code.
        * bridge/mac/WebCoreFrameNamespaces.mm: Removed. Dead Code.
        * bridge/mac/WebCorePageBridge.h: Removed. Dead Code.
        * bridge/mac/WebCorePageBridge.mm: Removed. Dead Code.
        * manual-tests/window-open-features-parsing.html: Updated for accuracy.
        (In this case, neither size nor position is specified, so you should
        get the default window size and position.)
        * page/Screen.cpp: Added. Includes screen-related helper functions used
        in WebCore and WebKit.
        * platform/PlatformMouseEvent.h: Exported common code so it doesn't have
        to be duplicated. Renamed "position" to "point" since both were used,
        and "point" seemed clearer.
        * platform/Screen.h: Removed. Dead Code.
        * platform/mac/LoggingMac.mm: Added. Moved code here from WebCorePageBridge
        initialization.

WebKit:

        Reviewed by Maciej, Darin, Anders.

        Removed the Page bridge. Beefed up Chrome. Added Screen and ScreenClient.
        
        (WebChromeClient::pageRect): It may seem weird for the page to ask the Chrome/ChromeClient
        about its own dimensions. The idea here is that we're asking the Chrome how
        much space it has devoted to the page. We have API for this (-webViewContentRect), but 
        it was documented incorrectly (even Safari used it wrong), so we don't use 
        it anymore. Once we fix our API/documentation, we can return to making a
        delegate callback to ask for the page's size.
        (WebChromeClient::createWindow): Changed to take a FrameLoadRequest with
        an appropriate referrer, instead of making up its own.
        (WebChromeClient::createModalDialog): Changed to take a FrameLoadRequest with
        an appropriate referrer, instead of broken out parcels.
        * WebCoreSupport/WebPageBridge.h: Removed. Dead Code.
        * WebCoreSupport/WebPageBridge.mm: Removed. Dead Code.
        * WebCoreSupport/WebScreenClient.h: Added.
        * WebCoreSupport/WebScreenClient.mm: Added.
        * WebView/WebView.mm: Added NULL checks for new _private->page, since
        it's not NULL-safe like the bridge was, and it gets cleared before
        dealloc.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@17631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 10acb93c
2006-11-06 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej, Anders, Darin.
Removed the Page bridge. Beefed up Chrome. Added Screen and ScreenClient.
Fixed a minor where WebCore would always assume it was displayed on the
monitor containing the menubar. window.open and window.showModalDialog
are now cross-platform.
Layout tests, manual-tests/show-modal-dialog, and manual-tests/
window-open-features-parsing all pass. I verified the new screen functionality
by running in DRT, and checking whether WebCore knew it was off-screen.
Some refactoring remains, as all were not pleased by this design. I see
in my future another patch.
* bindings/js/kjs_window.cpp: Screen is now a stand-alone object with a
client, to encapsulate asking the platform questions about the screen occupied by
the page. (Previously, we always assumed we were on screen 0, which was a bug.)
* bridge/mac/WebCoreFrameBridge.mm:
(createMouseEventFromDraggingInfo): Reversed argument order, to match other
functions.
(-[WebCoreFrameBridge dragSourceMovedTo:]): ditto
(-[WebCoreFrameBridge dragSourceEndedAt:operation:]): ditto
* bridge/mac/WebCoreFrameNamespaces.h: Removed. Dead Code.
* bridge/mac/WebCoreFrameNamespaces.mm: Removed. Dead Code.
* bridge/mac/WebCorePageBridge.h: Removed. Dead Code.
* bridge/mac/WebCorePageBridge.mm: Removed. Dead Code.
* manual-tests/window-open-features-parsing.html: Updated for accuracy.
(In this case, neither size nor position is specified, so you should
get the default window size and position.)
* page/Screen.cpp: Added. Includes screen-related helper functions used
in WebCore and WebKit.
* platform/PlatformMouseEvent.h: Exported common code so it doesn't have
to be duplicated. Renamed "position" to "point" since both were used,
and "point" seemed clearer.
* platform/Screen.h: Removed. Dead Code.
* platform/mac/LoggingMac.mm: Added. Moved code here from WebCorePageBridge
initialization.
2006-11-06 Graham Dennis <graham.dennis@gmail.com>
Reviewed by Tim Hatcher.
......@@ -107,12 +107,10 @@
.objc_class_name_WebCoreCache
.objc_class_name_WebCoreEncodings
.objc_class_name_WebCoreFrameBridge
.objc_class_name_WebCoreFrameNamespaces
.objc_class_name_WebCoreHistory
.objc_class_name_WebCoreIconDatabaseBridge
.objc_class_name_WebCoreJavaScript
.objc_class_name_WebCoreKeyGenerator
.objc_class_name_WebCorePageBridge
.objc_class_name_WebCorePageState
.objc_class_name_WebCoreScriptDebugger
.objc_class_name_WebCoreSettings
......@@ -161,11 +159,13 @@ __ZN7WebCore11FrameLoader9setClientEPNS_17FrameLoaderClientE
__ZN7WebCore11RenderLayer18gAlignCenterAlwaysE
__ZN7WebCore11selectRangeEPNS_19SelectionControllerEPNS_5RangeENS_9EAffinityEb
__ZN7WebCore12AtomicString3addEPNS_10StringImplE
__ZN7WebCore12nsURLRequestERKNS_15ResourceRequestE
__ZN7WebCore13HitTestResultC1ERKNS_8IntPointE
__ZN7WebCore13HitTestResultC1ERKS0_
__ZN7WebCore13HitTestResultD1Ev
__ZN7WebCore13HitTestResultaSERKS0_
__ZN7WebCore13KeyboardEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowERKNS_6StringEjbbbbb
__ZN7WebCore13scaleToScreenERKNS_9FloatRectEP8NSScreen
__ZN7WebCore14DocumentLoader12setCommittedEb
__ZN7WebCore14DocumentLoader13attachToFrameEv
__ZN7WebCore14DocumentLoader15detachFromFrameEv
......@@ -177,6 +177,8 @@ __ZN7WebCore14DocumentLoaderC2EP12NSURLRequest
__ZN7WebCore14DocumentLoaderD2Ev
__ZN7WebCore14RenderListItem17markerStringValueEv
__ZN7WebCore14ResourceLoader14cancelledErrorEv
__ZN7WebCore14flipScreenRectERK7_NSRectP8NSScreen
__ZN7WebCore15scaleFromScreenERK7_NSRectP8NSScreen
__ZN7WebCore16DeprecatedString6appendENS_14DeprecatedCharE
__ZN7WebCore16DeprecatedString6appendERKS0_
__ZN7WebCore16DeprecatedString6appendEc
......@@ -195,9 +197,14 @@ __ZN7WebCore19SelectionController9selectAllEv
__ZN7WebCore21PlatformKeyboardEventC1EP7NSEventb
__ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
__ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEP11objc_object
__ZN7WebCore36InitializeLoggingChannelsIfNecessaryEv
__ZN7WebCore4KURLC1EP5NSURL
__ZN7WebCore4KURLC1ERKNS_16DeprecatedStringE
__ZN7WebCore4Page12setGroupNameERKNS_6StringE
__ZN7WebCore4Page12setMainFrameEN3WTF10PassRefPtrINS_5FrameEEE
__ZN7WebCore4Page16setDefersLoadingEb
__ZN7WebCore4PageC1EN3WTF10PassRefPtrINS_12ChromeClientEEENS2_INS_12ScreenClientEEE
__ZN7WebCore4PageD1Ev
__ZN7WebCore5Frame11clearTimersEv
__ZN7WebCore5Frame11completeURLERKNS_16DeprecatedStringE
__ZN7WebCore5Frame11setSettingsEPNS_8SettingsE
......@@ -222,6 +229,7 @@ __ZN7WebCore6Editor30deleteSelectionWithSmartDeleteEb
__ZN7WebCore6StringC1EP8NSString
__ZN7WebCore6StringC1EP8NSString
__ZN7WebCore6StringC1EPKc
__ZN7WebCore6screenEP8NSWindow
__ZN7WebCore7nsColorERKNS_5ColorE
__ZN7WebCore7nsColorERKNS_5ColorE
__ZN7WebCore8Document11completeURLERKNS_16DeprecatedStringE
......@@ -249,6 +257,8 @@ __ZN7WebCore8FrameMac9mouseDownEP7NSEvent
__ZN7WebCore8IntPointC1ERK7CGPoint
__ZN7WebCore8IntPointC1ERK8_NSPoint
__ZN7WebCore8parseURLERKNS_6StringE
__ZN7WebCore9FloatRect5scaleEf
__ZN7WebCore9FloatRectC1ERK7_NSRect
__ZN7WebCore9FrameTree11appendChildEN3WTF10PassRefPtrINS_5FrameEEE
__ZN7WebCore9FrameTree7setNameERKNS_12AtomicStringE
__ZN7WebCore9HTMLNames10listingTagE
......
This diff is collapsed.
......@@ -195,20 +195,20 @@ JSValue* Screen::getValueProperty(ExecState*, int token) const
switch (token) {
case Height:
return jsNumber(screenRect(page).height());
return jsNumber(page->screen()->rect().height());
case Width:
return jsNumber(screenRect(page).width());
return jsNumber(page->screen()->rect().width());
case ColorDepth:
case PixelDepth:
return jsNumber(screenDepth(page));
return jsNumber(page->screen()->depth());
case AvailLeft:
return jsNumber(usableScreenRect(page).x() - screenRect(page).x());
return jsNumber(page->screen()->usableRect().x() - page->screen()->rect().x());
case AvailTop:
return jsNumber(usableScreenRect(page).y() - screenRect(page).y());
return jsNumber(page->screen()->usableRect().y() - page->screen()->rect().y());
case AvailHeight:
return jsNumber(usableScreenRect(page).height());
return jsNumber(page->screen()->usableRect().height());
case AvailWidth:
return jsNumber(usableScreenRect(page).width());
return jsNumber(page->screen()->usableRect().width());
default:
return jsUndefined();
}
......@@ -628,7 +628,7 @@ static JSValue* showModalDialog(ExecState* exec, Window* openerWindow, const Lis
// - help: boolFeature(features, "help", true), makes help icon appear in dialog (what does it do on Windows?)
// - unadorned: trusted && boolFeature(features, "unadorned");
FloatRect screenRect = usableScreenRect(openerWindow->frame()->page());
FloatRect screenRect = openerWindow->frame()->page()->screen()->usableRect();
wargs.width = floatFeature(features, "dialogwidth", 100, screenRect.width(), 620); // default here came from frame size of dialog in MacIE
wargs.widthSet = true;
......@@ -745,9 +745,9 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
else
return jsNull();
case OuterHeight:
return jsNumber(m_frame->page()->windowRect().height());
return jsNumber(m_frame->page()->chrome()->windowRect().height());
case OuterWidth:
return jsNumber(m_frame->page()->windowRect().width());
return jsNumber(m_frame->page()->chrome()->windowRect().width());
case PageXOffset:
if (!m_frame->view())
return jsUndefined();
......@@ -764,10 +764,10 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
return personalbar(exec);
case ScreenLeft:
case ScreenX:
return jsNumber(m_frame->page()->windowRect().x());
return jsNumber(m_frame->page()->chrome()->windowRect().x());
case ScreenTop:
case ScreenY:
return jsNumber(m_frame->page()->windowRect().y());
return jsNumber(m_frame->page()->chrome()->windowRect().y());
case ScrollX:
if (!m_frame->view())
return jsUndefined();
......@@ -1568,7 +1568,7 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
WindowFeatures windowFeatures;
String features = args[2]->isUndefinedOrNull() ? UString() : args[2]->toString(exec);
parseWindowFeatures(features, windowFeatures);
constrainToVisible(screenRect(page), windowFeatures);
constrainToVisible(page->screen()->rect(), windowFeatures);
// prepare arguments
KURL url;
......@@ -1647,44 +1647,44 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
return jsUndefined();
case Window::MoveBy:
if (args.size() >= 2 && page) {
FloatRect r = page->windowRect();
FloatRect r = page->chrome()->windowRect();
r.move(args[0]->toNumber(exec), args[1]->toNumber(exec));
// Security check (the spec talks about UniversalBrowserWrite to disable this check...)
if (screenRect(page).contains(r))
page->setWindowRect(r);
if (page->screen()->rect().contains(r))
page->chrome()->setWindowRect(r);
}
return jsUndefined();
case Window::MoveTo:
if (args.size() >= 2 && page) {
FloatRect r = page->windowRect();
FloatRect sr = screenRect(page);
FloatRect r = page->chrome()->windowRect();
FloatRect sr = page->screen()->rect();
r.setLocation(sr.location());
r.move(args[0]->toNumber(exec), args[1]->toNumber(exec));
// Security check (the spec talks about UniversalBrowserWrite to disable this check...)
if (sr.contains(r))
page->setWindowRect(r);
page->chrome()->setWindowRect(r);
}
return jsUndefined();
case Window::ResizeBy:
if (args.size() >= 2 && page) {
FloatRect r = page->windowRect();
FloatRect r = page->chrome()->windowRect();
FloatSize dest = r.size() + FloatSize(args[0]->toNumber(exec), args[1]->toNumber(exec));
FloatRect sg = screenRect(page);
FloatRect sg = page->screen()->rect();
// Security check: within desktop limits and bigger than 100x100 (per spec)
if (r.x() + dest.width() <= sg.right() && r.y() + dest.height() <= sg.bottom()
&& dest.width() >= 100 && dest.height() >= 100)
page->setWindowRect(FloatRect(r.location(), dest));
page->chrome()->setWindowRect(FloatRect(r.location(), dest));
}
return jsUndefined();
case Window::ResizeTo:
if (args.size() >= 2 && page) {
FloatRect r = page->windowRect();
FloatRect r = page->chrome()->windowRect();
FloatSize dest = FloatSize(args[0]->toNumber(exec), args[1]->toNumber(exec));
FloatRect sg = screenRect(page);
FloatRect sg = page->screen()->rect();
// Security check: within desktop limits and bigger than 100x100 (per spec)
if (r.x() + dest.width() <= sg.right() && r.y() + dest.height() <= sg.bottom() &&
dest.width() >= 100 && dest.height() >= 100)
page->setWindowRect(FloatRect(r.location(), dest));
page->chrome()->setWindowRect(FloatRect(r.location(), dest));
}
return jsUndefined();
case Window::SetTimeout:
......@@ -2411,17 +2411,17 @@ JSValue *BarInfo::getValueProperty(ExecState *exec, int token) const
ASSERT(token == Visible);
switch (m_type) {
case Locationbar:
return jsBoolean(m_frame->locationbarVisible());
case Menubar:
return jsBoolean(m_frame->locationbarVisible());
return jsBoolean(m_frame->page()->chrome()->toolbarsVisible());
case Toolbar:
return jsBoolean(m_frame->page()->chrome()->toolbarsVisible());
case Personalbar:
return jsBoolean(m_frame->personalbarVisible());
return jsBoolean(m_frame->page()->chrome()->toolbarsVisible());
case Menubar:
return jsBoolean(m_frame->page()->chrome()->menubarVisible());
case Scrollbars:
return jsBoolean(m_frame->scrollbarsVisible());
return jsBoolean(m_frame->page()->chrome()->scrollbarsVisible());
case Statusbar:
return jsBoolean(m_frame->statusbarVisible());
case Toolbar:
return jsBoolean(m_frame->toolbarVisible());
return jsBoolean(m_frame->page()->chrome()->statusbarVisible());
default:
return jsBoolean(false);
}
......
......@@ -147,11 +147,6 @@ public:
virtual bool runJavaScriptConfirm(const String&);
virtual bool runJavaScriptPrompt(const String& message, const String& defaultValue, String& result);
virtual bool shouldInterruptJavaScript();
virtual bool locationbarVisible();
virtual bool menubarVisible();
virtual bool personalbarVisible();
virtual bool statusbarVisible();
virtual bool toolbarVisible();
FloatRect customHighlightLineRect(const AtomicString& type, const FloatRect& lineRect);
void paintCustomHighlight(const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect, bool text, bool line);
......
......@@ -30,6 +30,7 @@
#import "AXObjectCache.h"
#import "BeforeUnloadEvent.h"
#import "BlockExceptions.h"
#import "Chrome.h"
#import "CSSComputedStyleDeclaration.h"
#import "Cache.h"
#import "ClipboardEvent.h"
......@@ -552,7 +553,7 @@ void FrameMac::focusWindow()
// If we're a top level window, bring the window to the front.
if (!tree()->parent())
[_bridge activateWindow];
page()->chrome()->focus();
// Might not have a view yet: this could be a child frame that has not yet received its first byte of data.
// FIXME: Should remember that the frame needs focus. See <rdar://problem/4645685>.
......@@ -577,7 +578,7 @@ void FrameMac::unfocusWindow()
if ([_bridge firstResponder] == view) {
// If we're a top level window, deactivate the window.
if (!tree()->parent())
[_bridge deactivateWindow];
page()->chrome()->unfocus();
else {
// We want to shift focus to our parent.
FrameMac* parentFrame = static_cast<FrameMac*>(tree()->parent());
......@@ -1199,32 +1200,6 @@ bool FrameMac::shouldInterruptJavaScript()
return false;
}
bool FrameMac::locationbarVisible()
{
return [_bridge areToolbarsVisible];
}
bool FrameMac::menubarVisible()
{
// The menubar is always on in Mac OS X UI
return true;
}
bool FrameMac::personalbarVisible()
{
return [_bridge areToolbarsVisible];
}
bool FrameMac::statusbarVisible()
{
return [_bridge isStatusbarVisible];
}
bool FrameMac::toolbarVisible()
{
return [_bridge areToolbarsVisible];
}
void FrameMac::addMessageToConsole(const String &message, unsigned lineNumber, const String &sourceURL)
{
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
......
// -*- mode: c++; c-basic-offset: 4 -*-
/*
* Copyright (C) 2006 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import "config.h"
#import "Page.h"
#import "BlockExceptions.h"
#import "Frame.h"
#import "FloatRect.h"
#import "Screen.h"
#import "WebCorePageBridge.h"
namespace WebCore {
void Page::setBridge(WebCorePageBridge* bridge)
{
m_bridge = bridge;
}
// These methods scale between window and WebView coordinates because JavaScript/DOM operations
// assume that the WebView and the window share the same coordinate system.
FloatRect Page::windowRect() const
{
return scaleScreenRectToPageCoordinates(flipScreenRect([bridge() windowFrame]), this);
}
void Page::setWindowRect(const FloatRect& r)
{
[bridge() setWindowFrame:flipScreenRect(scalePageRectToScreenCoordinates(r, this))];
}
} // namespace WebCore
......@@ -34,6 +34,7 @@ namespace WebCore {
class EditorClient;
class Element;
class FrameMac;
class Page;
class String;
}
......@@ -60,7 +61,6 @@ typedef WebCore::FrameMac WebCoreFrameMac;
@class DOMNode;
@class DOMRange;
@class NSMenu;
@class WebCorePageBridge;
@class WebCoreSettings;
@class WebFrame;
@class WebScriptObject;
......@@ -187,7 +187,7 @@ typedef enum {
+ (WebCoreFrameBridge *)bridgeForDOMDocument:(DOMDocument *)document;
- (id)initMainFrameWithPage:(WebCorePageBridge *)page withEditorClient:(WebCoreEditorClient *)client;
- (id)initMainFrameWithPage:(WebCore::Page*)page withEditorClient:(WebCoreEditorClient *)client;
- (id)initSubframeWithOwnerElement:(WebCoreElement *)ownerElement withEditorClient:(WebCoreEditorClient *)client;
- (void)close;
......@@ -374,23 +374,12 @@ typedef enum {
- (NSView *)documentView;
- (WebCorePageBridge *)createWindowWithURL:(NSURL *)URL;
- (void)showWindow;
- (void)setStatusText:(NSString *)status;
- (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL referrer:(const WebCore::String&)referrer ownerElement:(WebCoreElement *)ownerElement allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
- (NSWindow *)window;
- (void)setToolbarsVisible:(BOOL)visible;
- (void)setStatusbarVisible:(BOOL)visible;
- (void)setScrollbarsVisible:(BOOL)visible;
- (void)setWindowIsResizable:(BOOL)resizable;
- (BOOL)areToolbarsVisible;
- (BOOL)isStatusbarVisible;
- (NSResponder *)firstResponder;
- (void)makeFirstResponder:(NSResponder *)responder;
- (void)willMakeFirstResponderForNodeFocus;
......@@ -408,9 +397,6 @@ typedef enum {
- (void)addMessageToConsole:(NSDictionary *)message;
- (void)runOpenPanelForFileButtonWithResultListener:(id <WebCoreOpenPanelResultListener>)resultListener;
- (void)activateWindow;
- (void)deactivateWindow;
- (void)formControlIsBecomingFirstResponder:(NSView *)formControl;
- (void)formControlIsResigningFirstResponder:(NSView *)formControl;
......
......@@ -58,6 +58,7 @@
#import "ModifySelectionListLevel.h"
#import "MoveSelectionCommand.h"
#import "Page.h"
#import "PlatformMouseEvent.h"
#import "PlugInInfoStore.h"
#import "RenderImage.h"
#import "RenderPart.h"
......@@ -73,7 +74,6 @@
#import "TextIterator.h"
#import "TypingCommand.h"
#import "WebCoreEditCommand.h"
#import "WebCorePageBridge.h"
#import "WebCoreSettings.h"
#import "WebCoreSystemInterface.h"
#import "WebCoreViewFactory.h"
......@@ -320,7 +320,7 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
return bridge([document _document]->frame());
}
- (id)initMainFrameWithPage:(WebCorePageBridge *)page withEditorClient:(WebCoreEditorClient *)client
- (id)initMainFrameWithPage:(WebCore::Page*)page withEditorClient:(WebCoreEditorClient *)client
{
if (!initializedKJS) {
mainThread = pthread_self();
......@@ -332,7 +332,7 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
if (!(self = [super init]))
return nil;
m_frame = new FrameMac([page impl], 0, client);
m_frame = new FrameMac(page, 0, client);
m_frame->setBridge(self);
_shouldCreateRenderers = YES;
......@@ -1577,16 +1577,11 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
return m_frame ? m_frame->baseWritingDirectionForSelectionStart() : (NSWritingDirection)NSWritingDirectionLeftToRight;
}
static IntPoint globalPoint(NSWindow* window, NSPoint windowPoint)
{
return IntPoint(flipScreenPoint([window convertBaseToScreen:windowPoint]));
}
static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id <NSDraggingInfo> info)
{
// FIXME: Fake modifier keys here.
// [info draggingLocation] is in window coords
return PlatformMouseEvent(IntPoint([info draggingLocation]), globalPoint(window, [info draggingLocation]),
return PlatformMouseEvent(IntPoint([info draggingLocation]), globalPoint([info draggingLocation], window),
LeftButton, 0, false, false, false, false);
}
......@@ -1663,7 +1658,7 @@ static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id
{
if (m_frame) {
// FIXME: Fake modifier keys here.
PlatformMouseEvent event(IntPoint(windowLoc), globalPoint([self window], windowLoc),
PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [self window]),
LeftButton, 0, false, false, false, false);
m_frame->dragSourceMovedTo(event);
}
......@@ -1673,7 +1668,7 @@ static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id
{
if (m_frame) {
// FIXME: Fake modifier keys here.
PlatformMouseEvent event(IntPoint(windowLoc), globalPoint([self window], windowLoc),
PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [self window]),
LeftButton, 0, false, false, false, false);
m_frame->dragSourceEndedAt(event, operation);
}
......
/*
* Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@interface WebCoreFrameNamespaces : NSObject
+ (NSEnumerator *)framesInNamespace:(NSString *)name;
@end
/*
* Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import "config.h"
#import "WebCoreFrameNamespaces.h"
#import "Page.h"
#import <wtf/HashSet.h>
using namespace WebCore;
@implementation WebCoreFrameNamespaces
+ (NSEnumerator *)framesInNamespace:(NSString *)name;
{
const HashSet<Page*>* set = Page::frameNamespace(name);
if (!set)
return [[[NSEnumerator alloc] init] autorelease];
NSMutableArray* array = [[NSMutableArray alloc] initWithCapacity:set->size()];
HashSet<Page*>::const_iterator end = set->end();
for (HashSet<Page*>::const_iterator it = set->begin(); it != end; ++it) {
[array addObject:(*it)->bridge()];
}
NSEnumerator* enumerator = [array objectEnumerator];
[array release];
return enumerator;
}
@end
......@@ -28,6 +28,7 @@
#include "config.h"
#include "MediaQueryEvaluator.h"
#include "Chrome.h"
#include "CSSPrimitiveValue.h"
#include "CSSValueList.h"
#include "DeprecatedString.h"
......@@ -207,7 +208,7 @@ static bool numberValue(CSSValue* value, float& result)
static bool colorMediaFeatureEval(CSSValue* value, RenderStyle* style, Page* page, MediaFeaturePrefix op)
{
int bitsPerComponent = screenDepthPerComponent(page);
int bitsPerComponent = page->screen()->depthPerComponent();
<