2009-09-18 Darin Adler Reviewed by Sam Weinig. Each wrapped Objective-C object should use a single RuntimeObjectImp https://bugs.webkit.org/show_bug.cgi?id=29351 rdar://problem/7142294 * WebCore.base.exp: Added a newly-needed exported symbol. * bindings/objc/DOMInternal.h: Eliminated unused createWrapperCacheWithIntegerKeys; it has not been needed since the RGBColor wrappers were reworked. * bindings/objc/DOMInternal.mm: Ditto. * bridge/objc/objc_instance.h: Made the create function non-inline. * bridge/objc/objc_instance.mm: (createInstanceWrapperCache): Added. Creates an appropriate map table. (ObjcInstance::create): Moved here from header. Uses NSMapGet and NSMapInsert to cache the instance in a map table. (ObjcInstance::~ObjcInstance): Added a call to NSMapRemove to remove the instance from the map table. * bridge/qt/qt_instance.cpp: (JSC::Bindings::QtInstance::~QtInstance): Remove unneeded code to remove the instance from cachedObjects, which no longer exists. (JSC::Bindings::QtInstance::newRuntimeObject): Renamed to overload new bottleneck. Caching is now handled by the base class. * bridge/runtime.cpp: (JSC::Bindings::Instance::Instance): Initialize m_runtimeObject to 0. (JSC::Bindings::Instance::~Instance): Assert m_runtimeObject is 0. (JSC::Bindings::Instance::createRuntimeObject): Use m_runtimeObject if it's already set. Set m_runtimeObject and call addRuntimeObject if it's not. (JSC::Bindings::Instance::newRuntimeObject): Added. Virtual function, used only by createRuntimeObject. (JSC::Bindings::Instance::willDestroyRuntimeObject): Added. Calls removeRuntimeObject and then clears m_runtimeObject. (JSC::Bindings::Instance::willInvalidateRuntimeObject): Added. Clears m_runtimeObject. * bridge/runtime.h: Made createRuntimeObject non-virtual. Added willDestroyRuntimeObject, willInvalidateRuntimeObject, newRuntimeObject, and m_runtimeObject. * bridge/runtime_object.cpp: (JSC::RuntimeObjectImp::RuntimeObjectImp): Removed addRuntimeObject call, now handled by caller. (JSC::RuntimeObjectImp::~RuntimeObjectImp): Replaced removeRuntimeObject call with willDestroyRuntimeObject call; the latter nows calls removeRuntimeObject. (JSC::RuntimeObjectImp::invalidate): Added willInvalidateRuntimeObject call. * bridge/runtime_object.h: Made invalidate non-virtual. 2009-09-18 Kenneth Rohde Christiansen Reviewed by Simon Hausmann. Make PlatformWindow return something else than PlatformWidget https://bugs.webkit.org/show_bug.cgi?id=29085 Make platformWindow return a PlatformPageClient (for now typedef'ed to PlatformWidget) Also, change the name of platformWindow to platformPageClient() * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (getPangoLayoutForAtk): * accessibility/win/AXObjectCacheWin.cpp: (WebCore::AXObjectCache::postPlatformNotification): (WebCore::AXObjectCache::handleFocusedUIElementChanged): * loader/EmptyClients.h: (WebCore::EmptyChromeClient::platformPageClient): * page/Chrome.cpp: (WebCore::Chrome::platformPageClient): * page/Chrome.h: * page/ChromeClient.h: * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::wheelEvent): (WebCore::EventHandler::currentPlatformMouseEvent): (WebCore::EventHandler::sendContextMenuEvent): (WebCore::EventHandler::eventMayStartDrag): * platform/HostWindow.h: * platform/Widget.h: * platform/gtk/PlatformScreenGtk.cpp: (WebCore::getVisual): (WebCore::screenRect): (WebCore::screenAvailableRect): * platform/gtk/PopupMenuGtk.cpp: (WebCore::PopupMenu::show): * platform/gtk/ScrollViewGtk.cpp: (WebCore::ScrollView::platformAddChild): (WebCore::ScrollView::platformRemoveChild): (WebCore::ScrollView::visibleContentRect): * platform/gtk/WidgetGtk.cpp: (WebCore::Widget::setFocus): (WebCore::Widget::setCursor): * platform/qt/PlatformScreenQt.cpp: (WebCore::screenDepth): (WebCore::screenDepthPerComponent): (WebCore::screenIsMonochrome): (WebCore::screenRect): (WebCore::screenAvailableRect): * platform/qt/PopupMenuQt.cpp: (WebCore::PopupMenu::show): * platform/qt/WidgetQt.cpp: (WebCore::Widget::setCursor): * platform/win/PlatformScreenWin.cpp: (WebCore::monitorInfoForWidget): * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenu::show): (WebCore::PopupMenu::calculatePositionAndSize): (WebCore::PopupMenu::wndProc): * platform/wx/RenderThemeWx.cpp: (WebCore::nativeWindowForRenderObject): * platform/wx/ScrollbarThemeWx.cpp: (WebCore::ScrollbarThemeWx::paint): * plugins/gtk/PluginViewGtk.cpp: (WebCore::PluginView::getValue): (WebCore::PluginView::forceRedraw): (WebCore::PluginView::platformStart): * plugins/mac/PluginViewMac.cpp: (WebCore::PluginView::platformStart): * plugins/qt/PluginViewQt.cpp: (WebCore::PluginView::handleKeyboardEvent): (WebCore::PluginView::getValue): (WebCore::PluginView::platformStart): * plugins/win/PluginViewWin.cpp: (WebCore::PluginView::getValue): (WebCore::PluginView::forceRedraw): (WebCore::PluginView::platformStart): 2009-09-18 Jocelyn Turcotte Reviewed by Simon Hausmann. [Qt] Web inspector UI adjustments specific to the Qt platform: - Hide the close button - Hide the dock button - Disable the draggable toolbar https://bugs.webkit.org/show_bug.cgi?id=29384 * inspector/front-end/inspector.css: * inspector/front-end/inspector.js: (WebInspector.toolbarDragStart): 2009-09-18 Joerg Bornemann Reviewed by Simon Hausmann. QtWebKit Windows CE compile fixes Exclude certain pure-WINCE specific code paths from the Qt build. * platform/graphics/BitmapImage.h: * platform/graphics/FontCache.h: * platform/graphics/MediaPlayer.cpp: * platform/text/TextEncodingRegistry.cpp: (WebCore::buildBaseTextCodecMaps): (WebCore::extendTextCodecMaps): * plugins/PluginView.cpp: (WebCore::PluginView::stop): Guard this code block with NETSCAPE_PLUGIN_API as the corresponding PluginViewWndProc has the same guard in the header file. 2009-09-18 Steve Block Reviewed by Dimitri Glazkov. Geolocation does not correctly handle Infinity for PositionOptions properties. https://bugs.webkit.org/show_bug.cgi?id=29099 * bindings/js/JSGeolocationCustom.cpp: Modified. (WebCore::createPositionOptions): Modified. If timeout or maximumAge is positive infinity, applies these values as a special case. * page/PositionOptions.h: Modified. (WebCore::PositionOptions::hasMaximumAge): Added. Determines whether the object has a maximum age. (WebCore::PositionOptions::maximumAge): Modified. Asserts that the object has a maximum age. (WebCore::PositionOptions::clearMaximumAge): Added. Clears the maximum age. (WebCore::PositionOptions::setMaximumAge): Modified. Registers that the maximum age has been set. (WebCore::PositionOptions::PositionOptions): Modified. Registers that the maximum age has been set. 2009-09-17 Sam Weinig Reviewed by Adele Peterson. Fix for https://bugs.webkit.org/show_bug.cgi?id=29276 REGRESSION(r48334): WebKit crashes on file select by drag Document.elementFromPoint now takes point in client space, not page space. * page/DragController.cpp: (WebCore::DragController::tryDocumentDrag): (WebCore::DragController::concludeEditDrag): 2009-09-17 Albert J. Wong Reviewed by David Levin. Reimplement default media UI for Mac Chromium to match the style of the Windows and Linux versions. Also breaks the dependency on the internal wk* functions that were previously used to render the media controller widgets. https://bugs.webkit.org/show_bug.cgi?id=29161 No media layout tests are currently enabled in Mac Chromium, so nothing needs rebaselineing, etc. This is a recommit of r48438 with a compile fix and merges of recent changes to the file. * css/mediaControlsChromium.css: * rendering/RenderThemeChromiumMac.h: * rendering/RenderThemeChromiumMac.mm: (WebCore::mediaElementParent): (WebCore::RenderThemeChromiumMac::extraMediaControlsStyleSheet): (WebCore::mediaSliderThumbImage): (WebCore::mediaVolumeSliderThumbImage): (WebCore::RenderThemeChromiumMac::paintSliderTrack): (WebCore::RenderThemeChromiumMac::adjustSliderThumbSize): (WebCore::RenderThemeChromiumMac::paintMediaButtonInternal): (WebCore::RenderThemeChromiumMac::paintMediaPlayButton): (WebCore::RenderThemeChromiumMac::paintMediaMuteButton): (WebCore::RenderThemeChromiumMac::paintMediaSliderTrack): (WebCore::RenderThemeChromiumMac::paintMediaVolumeSliderTrack): (WebCore::RenderThemeChromiumMac::paintMediaSliderThumb): (WebCore::RenderThemeChromiumMac::paintMediaVolumeSliderThumb): (WebCore::RenderThemeChromiumMac::paintMediaControlsBackground): * rendering/RenderThemeChromiumSkia.cpp: (WebCore::RenderThemeChromiumSkia::adjustSliderThumbSize): 2009-09-17 Brian Weinstein Reviewed by Timothy Hatcher. The Console scope bar should have a divider between All and the other possible values (Errors, Warnings, Logs). It will look something like: All | Errors Warnings Logs. * inspector/front-end/ConsoleView.js: (WebInspector.ConsoleView.createDividerElement): (WebInspector.ConsoleView): * inspector/front-end/inspector.css: 2009-09-17 Sam Weinig Reviewed by Mark Rowe. Remove additional references to JSVoidCallback which no longer exists. * DerivedSources.cpp: * WebCore.vcproj/WebCore.vcproj: 2009-09-17 Sam Weinig Reviewed by Brady Eidson. Remove commented out onhashchange attribute now that it is implemented. * page/DOMWindow.idl: 2009-09-17 Anders Carlsson Reviewed by Oliver Hunt. CrashTracer: 4800+ crashes in Safari at com.apple.WebKit • WTF::HashTableIterator... Make RuntimeObjectImp more robust against m_instance being a null (which can happen if an OOP plug-in crashes while we're calling into it). * bridge/runtime_object.cpp: (JSC::RuntimeObjectImp::RuntimeObjectImp): (JSC::RuntimeObjectImp::~RuntimeObjectImp): (JSC::RuntimeObjectImp::invalidate): (JSC::RuntimeObjectImp::fallbackObjectGetter): (JSC::RuntimeObjectImp::fieldGetter): (JSC::RuntimeObjectImp::methodGetter): (JSC::RuntimeObjectImp::getOwnPropertySlot): (JSC::RuntimeObjectImp::getOwnPropertyDescriptor): (JSC::RuntimeObjectImp::put): (JSC::RuntimeObjectImp::defaultValue): (JSC::RuntimeObjectImp::getCallData): (JSC::RuntimeObjectImp::getConstructData): (JSC::RuntimeObjectImp::getPropertyNames): * bridge/runtime_object.h: (JSC::RuntimeObjectImp::getInternalInstance): 2009-09-17 Yury Semikhatsky Reviewed by Timothy Hatcher. Wrap primitive values (as objects) in InspectorController::wrap. https://bugs.webkit.org/show_bug.cgi?id=28983 * inspector/InspectorController.cpp: (WebCore::InspectorController::wrapObject): objects of any type will be wrapped into proxies, only object proxies will have objectId. * inspector/front-end/ConsoleView.js: (WebInspector.ConsoleView.prototype.completions): there is InjectedScript.getCompletionsi that accepts an expression and returns possible completions. This way we don't need to wrap and unwrap the completions result into a proxy object. * inspector/front-end/InjectedScript.js: (InjectedScript.getCompletions): (InjectedScript.evaluate): (InjectedScript._evaluateOn): (InjectedScript.createProxyObject): * inspector/front-end/InjectedScriptAccess.js: 2009-09-17 Nate Chapin Reviewed by Dimitri Glazkov. Wrap PageTransitionEvents properly for V8's use. https://bugs.webkit.org/show_bug.cgi?id=29340 Fixes Chromium's failures for LayoutTests/fast/events/pageshow-pagehide.html. * bindings/v8/V8DOMWrapper.cpp: (WebCore::V8DOMWrapper::convertEventToV8Object): Wrap PageTransitionEvents properly. 2009-09-17 Simon Fraser Reviewed by Dave Hyatt. Hardware-accelerated opacity transition on inline asserts https://bugs.webkit.org/show_bug.cgi?id=29342 Remove an erroneous toRenderBox() that could be called on a RenderInline; we can just pass an empty size, because the box size is only required for transform animations. Test: compositing/transitions/opacity-on-inline.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::startTransition): 2009-09-17 Adam Barth Reviewed by Eric Seidel. [V8] OwnHandle might get a weak callback after destruction https://bugs.webkit.org/show_bug.cgi?id=29172 Be sure to clear out weak reference so we don't get a weak callback after we've destructed ourselves. Also, removed some tricky methods that had no clients. * bindings/v8/OwnHandle.h: (WebCore::OwnHandle::clear): 2009-09-17 Dimitri Glazkov Unreviewed, build fix. [V8] Partial roll out of http://trac.webkit.org/changeset/48455 to fix crashes that started happening in V8Proxy::getEnteredContext(). * bindings/v8/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): 2009-09-17 Chris Fleizach Reviewed by Beth Dakin. AX: labels of checkboxes should, when hit-tested, return the checkbox https://bugs.webkit.org/show_bug.cgi?id=29335 When an accessibility hit test is done and it hits the label of a control element, the control element should be returned instead of nothing, since the label itself is usually ignored. Test: accessibility/label-for-control-hittest.html * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::correspondingControlForLabelElement): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::accessibilityIsIgnored): (WebCore::AccessibilityRenderObject::doAccessibilityHitTest): (WebCore::AccessibilityRenderObject::correspondingControlForLabelElement): * accessibility/AccessibilityRenderObject.h: 2009-09-17 Avi Drissman Reviewed by Dimitri Glazkov, build fix. Change to make RenderThemeChromiumMac compile inside of non PLATFORM(MAC). https://bugs.webkit.org/show_bug.cgi?id=29243 Covered by existing tests. * rendering/RenderThemeChromiumMac.mm: (WebCore::RenderThemeChromiumMac::paintMediaSliderTrack): 2009-09-17 Dimitri Glazkov Reviewed by Eric Seidel. [V8] Accessing properties/methods of an object, created with document.implementation.createDocumentType creates nodes that have no document (ScriptExecutionContext), which in turn produces NULL-ref crashes. https://bugs.webkit.org/show_bug.cgi?id=26402 Test: fast/dom/DOMImplementation/detached-doctype.html fast/dom/doctype-event-listener-crash.html * bindings/v8/V8DOMWrapper.cpp: (WebCore::V8DOMWrapper::getEventListener): Added an extra NULL-check. 2009-09-17 Dan Bernstein Reviewed by Simon Fraser. FontDescription.h includes RenderStyleConstants.h, which violates layering https://bugs.webkit.org/show_bug.cgi?id=29327 * GNUmakefile.am: Added FontSmoothingMode.h. * WebCore.gypi: Added FontSmoothingMode.h. * WebCore.vcproj/WebCore.vcproj: Added FontSmoothingMode.h. * WebCore.xcodeproj/project.pbxproj: Added FontSmoothingMode.h and made it a private header. * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Get the font smoothing mode via the font description. * css/CSSPrimitiveValueMappings.h: Include FontSmoothingMode.h (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Updated for the rename of FontSmoothing to FontSmoothingMode. (WebCore::CSSPrimitiveValue::operator FontSmoothingMode): Ditto. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applyProperty): Get the font smoothing mode via the font description. * platform/graphics/FontDescription.h: Do not include RenderStyleConstants.h. (WebCore::FontDescription::fontSmoothing): Updated for the rename of FontSmoothing to FontSmoothingMode. (WebCore::FontDescription::setFontSmoothing): Ditto. * platform/graphics/FontSmoothingMode.h: Added. (WebCore::FontSmoothingMode): Moved the FontSmoothing enum from RenderStyleConstants here and renamed it to this. * rendering/style/RenderStyle.h: (WebCore::InheritedFlags::fontSmoothing): Removed this getter, since this can be accessed via the font description. * rendering/style/RenderStyleConstants.h: Moved the FontSmoothing enum from here to FontSmoothingMode.h. 2009-09-17 Kevin Ollivier wx 2.9 build fix. * platform/wx/wxcode/gtk/scrollbar_render.cpp: (wxGetGdkWindowForDC): 2009-09-16 Simon Fraser Reviewed by Dan Bernstein. Elements appear behind