1. 19 May, 2013 1 commit
    • andersca@apple.com's avatar
      Remove link prerendering code · a82aee4a
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=116415
      
      Reviewed by Darin Adler.
      
      .:
      
      This code was only used by Chromium and is dead now.
      
      * Source/autotools/SetupWebKitFeatures.m4:
      * Source/cmake/WebKitFeatures.cmake:
      * Source/cmakeconfig.h.cmake:
      
      Source/JavaScriptCore:
      
      This code was only used by Chromium and is dead now.
      
      * Configurations/FeatureDefines.xcconfig:
      
      Source/WebCore:
      
      * Configurations/FeatureDefines.xcconfig:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.vcxproj/WebCore.vcxproj:
      * WebCore.vcxproj/WebCore.vcxproj.filters:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/Document.cpp:
      (WebCore::Document::Document):
      * dom/Document.h:
      (WebCore):
      (Document):
      * dom/EventNames.h:
      (WebCore):
      * html/HTMLLinkElement.cpp:
      * html/HTMLLinkElement.h:
      * html/LinkRelAttribute.cpp:
      (WebCore::LinkRelAttribute::LinkRelAttribute):
      * html/LinkRelAttribute.h:
      (LinkRelAttribute):
      * loader/LinkLoader.cpp:
      (WebCore::LinkLoader::~LinkLoader):
      (WebCore::LinkLoader::loadLink):
      (WebCore::LinkLoader::released):
      * loader/LinkLoader.h:
      (WebCore):
      (LinkLoader):
      * loader/LinkLoaderClient.h:
      (LinkLoaderClient):
      * loader/Prerenderer.cpp: Removed.
      * loader/Prerenderer.h: Removed.
      * loader/PrerendererClient.cpp: Removed.
      * loader/PrerendererClient.h: Removed.
      * platform/PrerenderClient.h: Removed.
      * platform/PrerenderHandle.h: Removed.
      
      Source/WebKit/blackberry:
      
      This code was only used by Chromium and is dead now.
      
      * WebCoreSupport/AboutDataEnableFeatures.in:
      
      Source/WebKit/mac:
      
      This code was only used by Chromium and is dead now.
      
      * Configurations/FeatureDefines.xcconfig:
      
      Source/WebKit2:
      
      This code was only used by Chromium and is dead now.
      
      * Configurations/FeatureDefines.xcconfig:
      
      Source/WTF:
      
      This code was only used by Chromium and is dead now.
      
      * wtf/FeatureDefines.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a82aee4a
  2. 15 May, 2013 1 commit
    • barraclough@apple.com's avatar
      Process suppression should throttle scripted animations · bbd85caa
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=115812
      
      Reviewed by Simon Fraser.
      
      <rdar://problem/13799726>
      
      Source/WebCore: 
      
      * WebCore.exp.in:
          - Expose Page::setThrottled
      * dom/Document.cpp:
      (WebCore::Document::scriptedAnimationControllerSetThrottled):
      (WebCore):
      * dom/Document.h:
      (Document):
          - Forwards to ScriptedAnimationController::setThrottled
      * dom/ScriptedAnimationController.cpp:
      (WebCore::ScriptedAnimationController::setThrottled):
      (WebCore):
      * dom/ScriptedAnimationController.h:
          - Force use of a timer.
      (ScriptedAnimationController):
      * page/Page.cpp:
      (WebCore::Page::setThrottled):
      (WebCore):
      * page/Page.h:
      (Page):
          - When under throttling force the ScriptedAnimationController to use a timer.
      
      Source/WebKit2: 
      
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::setThrottled):
      (WebKit):
      * WebProcess/WebPage/WebPage.h:
      (WebPage):
          - Added setThrottled, forwards to WebCore::Page.
      * WebProcess/WebProcess.cpp:
      (WebKit):
      (WebKit::WebProcess::setProcessSuppressionEnabled):
      * WebProcess/WebProcess.h:
      (WebProcess):
          - Intercept calls to setProcessSuppressionEnabled, also mark all pages as being throttled.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bbd85caa
  3. 13 May, 2013 1 commit
  4. 12 May, 2013 1 commit
  5. 10 May, 2013 1 commit
  6. 09 May, 2013 1 commit
    • andersca@apple.com's avatar
      Add a StorageStrategy hook for creating transient local storage namespaces · 668179f9
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=115870
      
      Reviewed by Geoffrey Garen.
      
      * WebCore.exp.in:
      Export symbol needed by WebKit2.
      
      * dom/Document.cpp:
      (WebCore::Document::topOrigin):
      * dom/Document.h:
      * dom/ScriptExecutionContext.h:
      * workers/WorkerContext.h:
      Remove const qualifier from topOrigin() to avoid ugly const_casts when assigning into a RefPtr<SecurityOrigin> variable.
      
      * page/PageGroup.cpp:
      (WebCore::PageGroup::transientLocalStorage):
      Do a single hash lookup instead of three and use the SecurityOrigin itself as the hash key instead of a string representation of it.
      
      * page/PageGroup.h:
      Update HashMap declaration.
      
      * storage/StorageNamespace.cpp:
      (WebCore::StorageNamespace::transientLocalStorageNamespace):
      Add new implementation that will optionally call out to the storage strategy.
      
      * storage/StorageNamespaceImpl.cpp:
      (WebCore::StorageNamespaceImpl::transientLocalStorageNamespace):
      Move the default implementation here from PageGroup.
      
      * storage/StorageStrategy.cpp:
      (WebCore::StorageStrategy::transientLocalStorageNamespace):
      Call the default implementation.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      668179f9
  7. 07 May, 2013 1 commit
    • rniwa@webkit.org's avatar
      Devirtualize Document class type checking · d18be865
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=115755
      
      Reviewed by Benjamin Poulain.
      
      Merge https://chromium.googlesource.com/chromium/blink/+/dae5adc768d5ce6bff301df6515745da8ea24950
      
      Document has a bunch of virtual bool is*Document() methods on it, but it also has
      two bools for XHTML and HTML documents which is silly. We can merge them all
      together into an enum of values and devirtualize the type checking methods.
      
      * dom/Document.cpp:
      (WebCore::Document::Document):
      (WebCore::Document::createElement):
      * dom/Document.h:
      (WebCore::Document::create):
      (WebCore::Document::createXHTML):
      (WebCore::Document::isHTMLDocument):
      (WebCore::Document::isXHTMLDocument):
      (WebCore::Document::isImageDocument):
      (WebCore::Document::isSVGDocument):
      (WebCore::Document::isPluginDocument):
      (WebCore::Document::isMediaDocument):
      (WebCore::Document):
      * html/HTMLDocument.cpp:
      (WebCore::HTMLDocument::HTMLDocument):
      * html/HTMLDocument.h:
      (WebCore::HTMLDocument):
      * html/ImageDocument.cpp:
      (WebCore::ImageDocument::ImageDocument):
      * html/ImageDocument.h:
      (WebCore::ImageDocument):
      * html/MediaDocument.cpp:
      (WebCore::MediaDocument::MediaDocument):
      * html/MediaDocument.h:
      (WebCore::MediaDocument):
      * html/PluginDocument.cpp:
      (WebCore::PluginDocument::PluginDocument):
      * html/PluginDocument.h:
      (WebCore::PluginDocument):
      * loader/PlaceholderDocument.h:
      (WebCore::PlaceholderDocument::PlaceholderDocument):
      * svg/SVGDocument.cpp:
      (WebCore::SVGDocument::SVGDocument):
      * svg/SVGDocument.h:
      (WebCore::SVGDocument):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d18be865
  8. 06 May, 2013 1 commit
    • graouts@apple.com's avatar
      Manage the presentation of the snapshotted plug-in using JavaScript · 3828a6ec
      graouts@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=115548
      
      Reviewed by Dean Jackson.
      
      Source/WebCore:
      
      * Resources/plugIns.js:
      (createOverlay):
      Implement the createOverlay(shadowRoot, titleText, subtitleText) method
      that is called from WebCore (HTMLPlugInImageElement::didAddUserAgentShadowRoot)
      to allow the injected script to customize the shadow root for a snapshotted
      plug-in. This is a default implementation, clients are expected to customize
      this by providing their own JS file with enhanced behavior.
      
      * css/CSSDefaultStyleSheets.cpp:
      (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
      Since we no longer have a default shadow tree generated in C++, it makes little
      sense for clients to extend the default snapshotted plug-in stylesheet, so we
      only insert it if no custom one is provided by the chrome client.
      
      * css/plugIns.css:
      Better styling of the default snapshotted plug-in overlay look by using CSS
      flex boxes. Also using more explicit selector as an optimization.
      
      * dom/Document.cpp:
      (WebCore::Document::ensurePlugInsInjectedScript):
      Expose a new method to allow HTMLPlugInImageElement instances to ensure that
      the JavaScript code required to customize the snapshotted plug-in's shadow root
      is indeed injected in the current document. The actual injection would only
      happen once per document so all snapshotted plug-ins share the same scripting
      context.
      
      * dom/Document.h:
      Expose the new ensurePlugInsInjectedScript method and the m_hasInjectedPlugInsScript
      property used to ensure injection happens only once per document.
      
      * html/HTMLPlugInImageElement.cpp:
      (WebCore::titleText):
      (WebCore::subtitleText):
      Store the localized strings for each mime-type in a static hash map as it can be
      costly to retrieve them each time from the client. It is expected the chrome client
      will want to provide localized strings taking into account the snapshotted plug-in's
      mime-type, so we're adding this as a parameter.
      (WebCore::HTMLPlugInImageElement::checkSnapshotStatus):
      Dispatch a "resize" event to the shadow root to notify the injected script that the
      snapshotted plug-in's metrics have changed and to allow the overlay to update itself
      as a result.
      (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
      Remove all the DOM generation code in favor of an approach where we create a shared
      DOM scripting world in which we inject JavaScript code that will perform the same
      task but will additionally be provided by the client in order to provide a completely
      custom overlay for the snapshotted plug-in. The sole contract is for the JavaScript
      to implement a createOverlay(shadowRoot, titleText, subtitleText) method.
      (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay):
      Renamed method to be generic to the overlay as opposed to text labels and use the
      element with CSS class name "snapshot-overlay" as the comparison node.
      
      * html/HTMLPlugInImageElement.h:
      (HTMLPlugInImageElement):
      Removing a couple of unused members since we no longer generate the shadow DOM from C++
      and rename the partOfSnapshotLabel method to partOfSnapshotOverlay.
      
      * page/ChromeClient.h:
      (WebCore::ChromeClient::plugInStartLabelTitle):
      (WebCore::ChromeClient::plugInStartLabelSubtitle):
      (WebCore::ChromeClient::plugInExtraScript):
      Pass in the mime-type to plugInStartLabelTitle and plugInStartLabelSubtitle and expose
      a new plugInExtraScript method to allow the chrome client to provide a custom JS file
      for the management of the shadow root.
      
      * rendering/RenderSnapshottedPlugIn.cpp:
      (WebCore::RenderSnapshottedPlugIn::handleEvent):
      Update the terminology from "label" to "overlay" per the changes made in HTMLPlugInImageElement.
      
      Source/WebKit2:
      
      Expose a new plugInExtraScript method to support the injection of
      a JS file from the chrome client to customize the rendering of a
      snapshotted plug-in's shadow tree. Additionally, it is expected
      the chrome client will want to provide localized strings taking
      into account the snapshotted plug-in's mime-type, so we're adding
      this as a parameter to both plugInStartLabelTitle and
      plugInStartLabelSubtitle methods.
      
      * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
      * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
      (WebKit::InjectedBundlePageUIClient::plugInStartLabelTitle):
      (WebKit::InjectedBundlePageUIClient::plugInStartLabelSubtitle):
      (WebKit::InjectedBundlePageUIClient::plugInExtraScript):
      * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
      (InjectedBundlePageUIClient):
      * WebProcess/WebCoreSupport/WebChromeClient.cpp:
      (WebKit::WebChromeClient::plugInStartLabelTitle):
      (WebKit::WebChromeClient::plugInStartLabelSubtitle):
      (WebKit::WebChromeClient::plugInExtraScript):
      * WebProcess/WebCoreSupport/WebChromeClient.h:
      (WebChromeClient):
      
      Tools:
      
      Take into account the new plugInExtraScript method added to support
      the injection of a JS file from the chrome client to customize the
      rendering of a snapshotted plug-in's shadow tree.
      
      * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
      (WTR::InjectedBundlePage::InjectedBundlePage):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3828a6ec
  9. 30 Apr, 2013 1 commit
    • akling@apple.com's avatar
      Don't create StyleResolvers just to invalidate them. · c2cefd3a
      akling@apple.com authored
      <http://webkit.org/b/115436>
      
      Reviewed by Geoffrey Garen.
      
      Source/WebCore:
      
      Renamed Document::styleResolver() to ensureStyleResolver() so it's clear that it never returns null.
      Removed a bunch of unnecessary null-checks I spotted while doing this.
      
      Also fixed Element::willModifyAttribute() and FrameView::setFrameRect() to not create a StyleResolver
      and immediately invalidate it in some cases.
      
      * css/FontLoader.cpp:
      (WebCore::FontLoader::loadFont):
      (WebCore::FontLoader::checkFont):
      (WebCore::FontLoader::resolveFontStyle):
      * css/MediaQueryMatcher.cpp:
      (WebCore::MediaQueryMatcher::prepareEvaluator):
      * css/StyleMedia.cpp:
      (WebCore::StyleMedia::matchMedium):
      * dom/Document.cpp:
      (WebCore::Document::styleForElementIgnoringPendingStylesheets):
      (WebCore::Document::styleForPage):
      * dom/Document.h:
      (WebCore::Document::ensureStyleResolver):
      * dom/DocumentStyleSheetCollection.cpp:
      (WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags):
      (WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags):
      (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
      * dom/Element.cpp:
      (WebCore::StyleResolverParentPusher::push):
      (WebCore::StyleResolverParentPusher::~StyleResolverParentPusher):
      (WebCore::Element::styleForRenderer):
      (WebCore::Element::recalcStyle):
      (WebCore::Element::willModifyAttribute):
      * dom/NodeRenderingContext.cpp:
      (WebCore::NodeRenderingContext::createRendererForTextIfNeeded):
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::recalcStyle):
      (WebCore::ShadowRoot::attach):
      * dom/Text.cpp:
      (WebCore::Text::recalcTextStyle):
      * editing/EditingStyle.cpp:
      (WebCore::styleFromMatchedRulesForElement):
      * html/HTMLCanvasElement.cpp:
      * html/HTMLCanvasElement.h:
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::customStyleForRenderer):
      * html/HTMLOptGroupElement.cpp:
      (WebCore::HTMLOptGroupElement::updateNonRenderStyle):
      * html/HTMLOptionElement.cpp:
      (WebCore::HTMLOptionElement::updateNonRenderStyle):
      * html/HTMLPlugInImageElement.cpp:
      (WebCore::HTMLPlugInImageElement::customStyleForRenderer):
      * html/canvas/CanvasRenderingContext2D.cpp:
      (WebCore::CanvasRenderingContext2D::setFont):
      * html/shadow/DateTimeEditElement.cpp:
      (WebCore::DateTimeEditElement::customStyleForRenderer):
      * inspector/InspectorCSSAgent.cpp:
      (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
      * page/DOMWindow.cpp:
      (WebCore::DOMWindow::getMatchedCSSRules):
      * page/FrameView.cpp:
      (WebCore::FrameView::setFrameRect):
      * page/animation/KeyframeAnimation.cpp:
      (WebCore::KeyframeAnimation::KeyframeAnimation):
      * rendering/RenderListBox.cpp:
      (WebCore::RenderListBox::updateFromElement):
      (WebCore::RenderListBox::paintItemForeground):
      * rendering/RenderMenuList.cpp:
      (WebCore::RenderMenuList::fontSelector):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::getUncachedPseudoStyle):
      * rendering/RenderRegion.cpp:
      (WebCore::RenderRegion::checkRegionStyle):
      (WebCore::RenderRegion::computeStyleInRegion):
      * rendering/RenderSearchField.cpp:
      (WebCore::RenderSearchField::fontSelector):
      * rendering/svg/RenderSVGInlineText.cpp:
      (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
      * svg/SVGElement.cpp:
      (WebCore::SVGElement::customStyleForRenderer):
      * svg/SVGElementRareData.h:
      (WebCore::SVGElementRareData::overrideComputedStyle):
      
      Source/WebKit/qt:
      
      * Api/qwebelement.cpp:
      (QWebElement::styleProperty):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c2cefd3a
  10. 28 Apr, 2013 1 commit
    • rniwa@webkit.org's avatar
      StaticHashSetNodeList is unnecessary · 9db31906
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=115219
      
      Reviewed by Antonio Gomes.
      
      Source/WebCore: 
      
      Moved Document::nodesFromRect into Internals::nodesFromRect per
      https://chromium.googlesource.com/chromium/blink/+/78207c5c34383fbb807bb9347deb67168f09bb04.
      
      Also made TouchAdjustment functions use HashListSet directly instead of wrapping it inside
      a StaticHashSetNodeList since there was no need to use the latter.
      
      With these two changes, I deleted StaticHashSetNodeList.
      
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.exp.in:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/Document.cpp:
      (WebCore):
      * dom/Document.h:
      (Document):
      * dom/StaticHashSetNodeList.cpp: Removed.
      * dom/StaticHashSetNodeList.h: Removed.
      * page/EventHandler.cpp:
      (WebCore::EventHandler::bestClickableNodeForTouchPoint):
      (WebCore::EventHandler::bestContextMenuNodeForTouchPoint):
      (WebCore::EventHandler::bestZoomableAreaForTouchPoint):
      * page/TouchAdjustment.cpp:
      (WebCore::TouchAdjustment::compileSubtargetList):
      (WebCore::TouchAdjustment::compileZoomableSubtargets):
      (WebCore::findBestClickableCandidate):
      (WebCore::findBestContextMenuCandidate):
      (WebCore::findBestZoomableArea):
      * page/TouchAdjustment.h:
      (WebCore):
      * testing/Internals.cpp:
      (WebCore::Internals::nodesFromRect):
      
      Source/WebKit: 
      
      * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
      
      Source/WebKit/win: 
      
      * WebKit.vcproj/WebKitExports.def.in:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9db31906
  11. 26 Apr, 2013 2 commits
    • commit-queue@webkit.org's avatar
      use-after-free removing a frame from its parent in a beforeload event of an OBJECT element · 89c9ced3
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=113964
      
      Source/WebCore:
      
      Object elements have the tendecny to modify or even fully remove
      the containing Document inside beforeload callback. While Document is removed,
      RenderArena gets destroyed. Retained RenderWidgets fails to function with NULL arena.
      
      Protect RendereArena from getting wiped out, when Document is removed
      during FrameView::updateWidget().
      
      Patch by Zalan Bujtas <zalan@apple.com> on 2013-04-26
      Reviewed by Antti Koivisto.
      
      Test: fast/frames/crash-remove-iframe-during-object-beforeload.html
      
      * dom/Document.cpp:
      (WebCore::Document::attach):
      * dom/Document.h:
      (Document):
      * page/FrameView.cpp:
      (WebCore::FrameView::updateWidgets):
      * rendering/RenderArena.h:
      (RenderArena):
      (WebCore::RenderArena::create):
      
      LayoutTests:
      
      Patch by Zalan Bujtas <zalan@apple.com> on 2013-04-26
      Reviewed by Antti Koivisto.
      
      * fast/frames/crash-remove-iframe-during-object-beforeload-expected.txt: Added.
      * fast/frames/crash-remove-iframe-during-object-beforeload.html: Added.
      * fast/frames/resources/remove-this-during-object-beforeload.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      89c9ced3
    • allan.jensen@digia.com's avatar
      Mouseenter and mouseleave events not supported · 1a84b4e4
      allan.jensen@digia.com authored
      https://bugs.webkit.org/show_bug.cgi?id=18930
      
      Reviewed by David Hyatt.
      
      Source/WebCore:
      
      Implements mouseenter and mouseleave events from W3C DOM Level 3 Events.
      These event are already supported by all other major browsers.
      
      To avoid performance regressions the new events are only dispatched when
      there are event listeners for them.
      
      Tests: fast/events/mouseenter-mouseleave-capture.html
             fast/events/mouseenter-mouseleave.html
      
      * bindings/scripts/CodeGenerator.pm:
      * dom/Document.cpp:
      (WebCore::Document::prepareMouseEvent):
      (WebCore::Document::updateHoverActiveState):
      * dom/Document.h:
      (Document):
      * dom/Document.idl:
      * dom/Element.h:
      (Element):
      * dom/Element.idl:
      * dom/EventListenerMap.cpp:
      (WebCore::EventListenerMap::containsCapturing):
      * dom/EventListenerMap.h:
      (EventListenerMap):
      * dom/EventNames.h:
      * dom/EventTarget.h:
      (EventTarget):
      (WebCore::EventTarget::hasCapturingEventListeners):
      * dom/MouseEvent.cpp:
      (WebCore::MouseEvent::create):
      (WebCore::MouseEvent::toElement):
      (WebCore::MouseEvent::fromElement):
      * html/HTMLAttributeNames.in:
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::eventNameForAttributeName):
      * page/DOMWindow.h:
      (DOMWindow):
      * page/DOMWindow.idl:
      * svg/SVGElement.cpp:
      (WebCore::SVGElement::parseAttribute):
      * svg/SVGElementInstance.h:
      (SVGElementInstance):
      * svg/SVGElementInstance.idl:
      
      LayoutTests:
      
      To new tests that mouseenter and mouseleave works in both bubbling and capture phase.
      
      * fast/events/mouseenter-mouseleave-capture-expected.txt: Added.
      * fast/events/mouseenter-mouseleave-capture.html: Added.
      * fast/events/mouseenter-mouseleave-expected.txt: Added.
      * fast/events/mouseenter-mouseleave.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149173 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1a84b4e4
  12. 25 Apr, 2013 2 commits
    • joepeck@webkit.org's avatar
      ScriptExecutionContext log exception should include a column number · bdec8ed0
      joepeck@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=114315
      
      Reviewed by Oliver Hunt.
      
      Source/WebCore:
      
      Test: inspector/console/console-exception-stack-traces.html
      
      * bindings/js/ScriptCallStackFactory.h:
      * bindings/js/ScriptCallStackFactory.cpp:
      (WebCore::createScriptCallStackFromException):
      Generate a ScriptCallStack from an exception. Use the vm.exceptionStack
      if available, and fallback to the exception object where needed.
      
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::reportException):
      Always include a non-empty call stack with exceptions.
      Where not provided, fallback to the exception object.
      
      * dom/Document.h:
      * dom/Document.cpp:
      (WebCore::Document::logExceptionToConsole):
      * dom/ScriptExecutionContext.h:
      * dom/ScriptExecutionContext.cpp:
      (WebCore::ScriptExecutionContext::PendingException::PendingException):
      (ScriptExecutionContext::PendingException):
      (WebCore::ScriptExecutionContext::reportException):
      * workers/DefaultSharedWorkerRepository.cpp:
      * workers/SharedWorkerContext.cpp:
      (WebCore::SharedWorkerContext::logExceptionToConsole):
      * workers/SharedWorkerContext.h:
      * workers/WorkerContext.cpp:
      (WebCore::WorkerContext::logExceptionToConsole):
      * workers/WorkerContext.h:
      * workers/WorkerMessagingProxy.cpp:
      (WebCore::WorkerExceptionTask::performTask):
      Plumb columnNumber through as needed.
      
      LayoutTests:
      
      * inspector/console/console-exception-stack-traces-expected.txt: Added.
      * inspector/console/console-exception-stack-traces.html: Added.
      Verifies that exceptions have stack traces and match a console.trace stack.
      
      * http/tests/inspector-enabled/console-exception-while-no-inspector-expected.txt: Removed.
      * http/tests/inspector-enabled/console-exception-while-no-inspector.html: Removed.
      We now save exception backtraces even if the inspector is not open.
      
      * fast/dom/javascript-url-exception-isolation-expected.txt
      * fast/events/remove-target-with-shadow-in-drag-expected.txt
      * fast/events/set-attribute-listener-window-onerror-crash-expected.txt
      * inspector-protocol/media-query-listener-exception-expected.txt:
      * inspector/console/console-uncaught-exception-expected.txt:
      * inspector/console/console-uncaught-exception-in-eval-expected.txt:
      Update results that now include backtraces or different data. Most better, some worse.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bdec8ed0
    • joepeck@webkit.org's avatar
      Web Inspector: ConsoleMessage should include line and column number where possible · 379c8a1f
      joepeck@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=114929
      
      Source/WebCore:
      
        - adds "m_column" to WebCore::ConsoleMessage
        - adds "column" to Console.ConsoleMessage in the inspector protocol
        - set the column number for console.* functions (Console.cpp)
        - set the column number for XSLT errors (XSLTProcessor)
        - plumb columnNumber everywhere else it is needed, set it to 0 and file
          bugs for all cases missing columnNumber that could provide it.
      
      Reviewed by Timothy Hatcher.
      
      Test: inspector/console/console-url-line-column.html
            inspector/console/console-messages-stack-traces.html
      
      * inspector/ConsoleMessage.h:
      * inspector/ConsoleMessage.cpp:
      (WebCore::ConsoleMessage::ConsoleMessage):
      (WebCore::ConsoleMessage::autogenerateMetadata):
      (WebCore::ConsoleMessage::addToFrontend):
      (WebCore::ConsoleMessage::isEqual):
      Add m_column and set it where appropriate.
      
      * inspector/Inspector.json:
      Add column property to Console.ConsoleMessage.
      
      * page/Console.cpp:
      (WebCore::internalAddMessage):
      (WebCore::Console::profile):
      Set columnNumber like lineNumber from the last stack frame.
      (WebCore::Console::groupEnd):
      Line and column are unused in this message type, set both to 0.
      
      * xml/XSLTProcessorLibxslt.cpp:
      (WebCore::XSLTProcessor::parseErrorFunc):
      * xml/XSLTProcessorQt.cpp:
      (WebCore::XSLTMessageHandler::handleMessage):
      Add real column numbers, the XSLT handlers already had it available.
      
      * bindings/js/JSCustomXPathNSResolver.cpp:
      (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
      * css/CSSParser.cpp:
      (WebCore::CSSParser::logError):
      * dom/ScriptExecutionContext.h:
      * dom/ScriptExecutionContext.cpp:
      (WebCore::ScriptExecutionContext::addConsoleMessage):
      * dom/Document.cpp:
      (WebCore::Document::logExceptionToConsole):
      (WebCore::Document::addMessage):
      * dom/Document.h:
      * inspector/InspectorConsoleAgent.cpp:
      (WebCore::InspectorConsoleAgent::addMessageToConsole):
      (WebCore::InspectorConsoleAgent::stopTiming):
      (WebCore::InspectorConsoleAgent::didFinishXHRLoading):
      (WebCore::InspectorConsoleAgent::didReceiveResponse):
      (WebCore::InspectorConsoleAgent::didFailLoading):
      * inspector/InspectorConsoleAgent.h:
      * inspector/InspectorConsoleInstrumentation.h:
      (WebCore::InspectorInstrumentation::addMessageToConsole):
      (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsole):
      * inspector/InspectorInstrumentation.cpp:
      (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
      (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsoleImpl):
      (WebCore::InspectorInstrumentation::addProfileImpl):
      * inspector/InspectorInstrumentation.h:
      (InspectorInstrumentation):
      * inspector/InspectorProfilerAgent.cpp:
      (WebCore::InspectorProfilerAgent::addProfile):
      (WebCore::InspectorProfilerAgent::addProfileFinishedMessageToConsole):
      (WebCore::InspectorProfilerAgent::addStartProfilingMessageToConsole):
      (WebCore::InspectorProfilerAgent::start):
      (WebCore::InspectorProfilerAgent::stop):
      * inspector/InspectorProfilerAgent.h:
      (InspectorProfilerAgent):
      * loader/EmptyClients.h:
      (WebCore::EmptyChromeClient::addMessageToConsole):
      * page/ChromeClient.h:
      (WebCore::ChromeClient::addMessageToConsole):
      * page/ContentSecurityPolicy.cpp:
      (WebCore::ContentSecurityPolicy::logToConsole):
      * page/PageConsole.cpp:
      (WebCore::PageConsole::addMessage):
      * page/PageConsole.h:
      * workers/DefaultSharedWorkerRepository.cpp:
      (SharedWorkerProxy):
      (WebCore::postExceptionTask):
      (WebCore::SharedWorkerProxy::postExceptionToWorkerObject):
      (WebCore::postConsoleMessageTask):
      (WebCore::SharedWorkerProxy::postConsoleMessageToWorkerObject):
      * workers/SharedWorkerContext.cpp:
      (WebCore::SharedWorkerContext::logExceptionToConsole):
      * workers/WorkerContext.cpp:
      (WebCore::WorkerContext::logExceptionToConsole):
      (WebCore::WorkerContext::addConsoleMessage):
      (WebCore::WorkerContext::addMessage):
      (WebCore::WorkerContext::addMessageToWorkerConsole):
      * workers/WorkerContext.h:
      * workers/WorkerMessagingProxy.cpp:
      (WebCore::WorkerExceptionTask::create):
      (WebCore::WorkerExceptionTask::WorkerExceptionTask):
      (WebCore::WorkerExceptionTask::performTask):
      (WorkerExceptionTask):
      (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
      (WebCore::postConsoleMessageTask):
      (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):
      * workers/WorkerMessagingProxy.h:
      (WorkerMessagingProxy):
      * workers/WorkerReportingProxy.h:
      (WorkerReportingProxy):
      Plumb columnNumber through where appropriate. File bugs where missing.
      
      Source/WebKit/blackberry:
      
      Reviewed by Timothy Hatcher.
      
      * Api/DumpRenderTreeClient.h:
      * Api/WebPageClient.h:
      * WebCoreSupport/ChromeClientBlackBerry.cpp:
      (WebCore::ChromeClientBlackBerry::addMessageToConsole):
      * WebCoreSupport/ChromeClientBlackBerry.h:
      (ChromeClientBlackBerry):
      
      Source/WebKit/efl:
      
      Reviewed by Timothy Hatcher.
      
      * WebCoreSupport/ChromeClientEfl.cpp:
      (WebCore::ChromeClientEfl::addMessageToConsole):
      * WebCoreSupport/ChromeClientEfl.h:
      (ChromeClientEfl):
      
      Source/WebKit/gtk:
      
      Reviewed by Timothy Hatcher.
      
      * WebCoreSupport/ChromeClientGtk.cpp:
      (WebKit::ChromeClient::addMessageToConsole):
      * WebCoreSupport/ChromeClientGtk.h:
      (ChromeClient):
      
      Source/WebKit/mac:
      
      Reviewed by Timothy Hatcher.
      
      * WebCoreSupport/WebChromeClient.h:
      * WebCoreSupport/WebChromeClient.mm:
      (WebChromeClient::addMessageToConsole):
      
      Source/WebKit/qt:
      
      Reviewed by Timothy Hatcher.
      
      * WebCoreSupport/ChromeClientQt.cpp:
      (WebCore::ChromeClientQt::addMessageToConsole):
      * WebCoreSupport/ChromeClientQt.h:
      
      Source/WebKit/win:
      
      Reviewed by Timothy Hatcher.
      
      * WebCoreSupport/WebChromeClient.cpp:
      (WebChromeClient::addMessageToConsole):
      * WebCoreSupport/WebChromeClient.h:
      
      Source/WebKit/wince:
      
      Reviewed by Timothy Hatcher.
      
      * WebCoreSupport/ChromeClientWinCE.cpp:
      (WebKit::ChromeClientWinCE::addMessageToConsole):
      * WebCoreSupport/ChromeClientWinCE.h:
      
      Source/WebKit2:
      
      Reviewed by Timothy Hatcher.
      
      * WebProcess/WebCoreSupport/WebChromeClient.cpp:
      (WebKit::WebChromeClient::addMessageToConsole):
      * WebProcess/WebCoreSupport/WebChromeClient.h:
      
      LayoutTests:
      
      Update a test that was outputting the url and line number of console
      method calls, to output the column number as well. Added a test that
      verifies that console API messages have stack traces if appropriate.
      
      Reviewed by Timothy Hatcher.
      
      * inspector/console/console-url-and-line-expected.txt: Removed.
      * inspector/console/console-url-line-column-expected.txt: Added.
      * inspector/console/console-url-line-column.html: Renamed from LayoutTests/inspector/console/console-url-and-line.html.
      * inspector/console/console-messages-stack-traces-expected.txt: Added.
      * inspector/console/console-messages-stack-traces.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      379c8a1f
  13. 22 Apr, 2013 1 commit
    • benjamin@webkit.org's avatar
      Remove the memory instrumentation code · 9d72cb0b
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=114931
      
      Reviewed by Andreas Kling.
      
      .: 
      
      * Source/autotools/symbols.filter:
      
      Source/JavaScriptCore: 
      
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
      * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
      
      Source/WebCore: 
      
      The Memory Instrumentation code is unfinished and has already
      become out of sync the objects it is supposed to represent.
      
      The current approach does not seem maintainable, it is better to
      remove it before someone gets hurt.
      
      By removing the code, the binary become 1240976 bytes smaller.
      Yep, almost 1 Mb, bringing WebCore to the size it has 5 months ago :)
      
      * MostWebCoreFiles: remove the support for memory instrumentation.
      
      Source/WebKit: 
      
      * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
      
      Source/WebKit/mac: 
      
      * WebView/WebRenderLayer.mm:
      
      Source/WebKit/win: 
      
      * WebKit.vcproj/WebKitExports.def.in:
      
      Source/WTF: 
      
      On Mac x86_64, the code removal cause the binary to be
      9224 bytes smaller.
      
      * GNUmakefile.list.am:
      * WTF.pro:
      * WTF.vcproj/WTF.vcproj:
      * WTF.vcxproj/WTF.vcxproj:
      * WTF.vcxproj/WTF.vcxproj.filters:
      * WTF.xcodeproj/project.pbxproj:
      * wtf/CMakeLists.txt:
      * wtf/Forward.h:
      * wtf/ListHashSet.h:
      (ListHashSet):
      (ListHashSetNodeAllocator):
      (WTF::ListHashSetNodeAllocator::pool):
      (WTF::ListHashSetNodeAllocator::pastPool):
      * wtf/MemoryInstrumentation.cpp: Removed.
      * wtf/MemoryInstrumentation.h: Removed.
      * wtf/MemoryInstrumentationArrayBufferView.h: Removed.
      * wtf/MemoryInstrumentationHashCountedSet.h: Removed.
      * wtf/MemoryInstrumentationHashMap.h: Removed.
      * wtf/MemoryInstrumentationHashSet.h: Removed.
      * wtf/MemoryInstrumentationListHashSet.h: Removed.
      * wtf/MemoryInstrumentationSequence.h: Removed.
      * wtf/MemoryInstrumentationString.h: Removed.
      * wtf/MemoryInstrumentationVector.h: Removed.
      * wtf/MemoryObjectInfo.h: Removed.
      * wtf/text/AtomicString.h:
      * wtf/text/StringImpl.h:
      (WTF::StringImpl::isASCIILiteral):
      * wtf/text/WTFString.h:
      
      Tools: 
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp: Removed.
      
      LayoutTests: 
      
      * inspector/profiler/memory-instrumentation-cached-images-expected.txt: Removed.
      * inspector/profiler/memory-instrumentation-cached-images.html: Removed.
      * inspector/profiler/memory-instrumentation-canvas-expected.txt: Removed.
      * inspector/profiler/memory-instrumentation-canvas.html: Removed.
      * inspector/profiler/memory-instrumentation-external-array-expected.txt: Removed.
      * inspector/profiler/memory-instrumentation-external-array.html: Removed.
      * inspector/profiler/memory-instrumentation-external-string-expected.txt: Removed.
      * inspector/profiler/memory-instrumentation-external-string.html: Removed.
      * inspector/profiler/memory-instrumentation-test.js: Removed.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9d72cb0b
  14. 17 Apr, 2013 1 commit
  15. 12 Apr, 2013 1 commit
    • rniwa@webkit.org's avatar
      Unreviewed, rolling out r147942, r148026, and r148092. · e5d8680b
      rniwa@webkit.org authored
      http://trac.webkit.org/changeset/147942
      http://trac.webkit.org/changeset/148026
      http://trac.webkit.org/changeset/148092
      https://bugs.webkit.org/show_bug.cgi?id=114521
      
      "r147942 is buggy. Rollback all the patches depending on it."
      (Requested by abucur on #webkit).
      
      
      Source/WebCore:
      
      * dom/ContainerNode.cpp:
      (WebCore::willRemoveChildren):
      (WebCore):
      (WebCore::ContainerNode::removeChildren):
      * dom/Document.cpp:
      (WebCore::Document::nodeChildrenWillBeRemoved):
      (WebCore):
      * dom/Document.h:
      (Document):
      * dom/Node.cpp:
      * dom/Node.h:
      (Node):
      * dom/NodeTraversal.cpp:
      * dom/NodeTraversal.h:
      (ElementTraversal):
      (NodeTraversal):
      * dom/Range.cpp:
      (WebCore::boundaryNodeChildrenWillBeRemoved):
      (WebCore):
      (WebCore::Range::nodeChildrenWillBeRemoved):
      * dom/Range.h:
      * html/HTMLLIElement.cpp:
      (WebCore::HTMLLIElement::attach):
      * html/HTMLOListElement.cpp:
      (WebCore::HTMLOListElement::updateItemValues):
      (WebCore::HTMLOListElement::recalculateItemCount):
      * rendering/RenderCounter.cpp:
      (WebCore::previousInPreOrder):
      (WebCore::previousSiblingOrParent):
      (WebCore::parentElement):
      (WebCore::nextInPreOrder):
      * rendering/RenderListItem.cpp:
      (WebCore::enclosingList):
      (WebCore::RenderListItem::nextListItem):
      (WebCore::previousListItem):
      (WebCore::RenderListItem::calcValue):
      (WebCore::RenderListItem::explicitValueChanged):
      (WebCore::previousOrNextItem):
      (WebCore::RenderListItem::updateListMarkerNumbers):
      * rendering/RenderListItem.h:
      (RenderListItem):
      
      LayoutTests:
      
      * fast/dom/MutationObserver/added-out-of-order-expected.txt:
      * fast/dom/MutationObserver/added-out-of-order.html:
      * fast/dom/Range/range-remove-children-event-expected.txt: Removed.
      * fast/dom/Range/range-remove-children-event.html: Removed.
      * fast/dom/containerNode-expected.txt: Added.
      * fast/dom/containerNode.html: Added.
      * fast/dom/shadow/shadow-and-list-elements-expected.html:
      * fast/events/mutation-during-innerHTML-expected.txt: Removed.
      * fast/events/mutation-during-innerHTML.html: Removed.
      * fast/lists/positioned-count-crash-expected.txt:
      * fast/regions/counters/extract-list-items-001-expected.html: Removed.
      * fast/regions/counters/extract-list-items-001.html: Removed.
      * fast/regions/counters/extract-list-items-002-expected.html: Removed.
      * fast/regions/counters/extract-list-items-002.html: Removed.
      * fast/regions/counters/extract-list-items-003-expected.html: Removed.
      * fast/regions/counters/extract-list-items-003.html: Removed.
      * fast/regions/counters/extract-list-items-004-expected.html: Removed.
      * fast/regions/counters/extract-list-items-004.html: Removed.
      * fast/regions/counters/extract-list-items-005-expected.html: Removed.
      * fast/regions/counters/extract-list-items-005.html: Removed.
      * fast/regions/counters/extract-list-items-006-expected.html: Removed.
      * fast/regions/counters/extract-list-items-006.html: Removed.
      * fast/regions/counters/extract-list-items-007-expected.html: Removed.
      * fast/regions/counters/extract-list-items-007.html: Removed.
      * fast/regions/counters/extract-list-items-008-expected.html: Removed.
      * fast/regions/counters/extract-list-items-008.html: Removed.
      * fast/regions/counters/extract-list-items-009-expected.html: Removed.
      * fast/regions/counters/extract-list-items-009.html: Removed.
      * fast/regions/counters/extract-list-items-010-expected.html: Removed.
      * fast/regions/counters/extract-list-items-010.html: Removed.
      * fast/regions/counters/extract-list-items-011-expected.html: Removed.
      * fast/regions/counters/extract-list-items-011.html: Removed.
      * fast/regions/counters/extract-list-items-012-expected.html: Removed.
      * fast/regions/counters/extract-list-items-012.html: Removed.
      * fast/regions/counters/extract-list-items-013-expected.html: Removed.
      * fast/regions/counters/extract-list-items-013.html: Removed.
      * fast/regions/counters/extract-list-items-014-expected.html: Removed.
      * fast/regions/counters/extract-list-items-014.html: Removed.
      * fast/regions/counters/extract-list-items-015-expected.html: Removed.
      * fast/regions/counters/extract-list-items-015.html: Removed.
      * fast/regions/counters/extract-numbered-paragraphs-divs-001-expected.html: Removed.
      * fast/regions/counters/extract-numbered-paragraphs-divs-001.html: Removed.
      * fast/regions/counters/extract-numbered-paragraphs-divs-002-expected.html: Removed.
      * fast/regions/counters/extract-numbered-paragraphs-divs-002.html: Removed.
      * fast/regions/counters/extract-numbered-paragraphs-expected.html: Removed.
      * fast/regions/counters/extract-numbered-paragraphs.html: Removed.
      * fast/regions/counters/extract-numbered-spans-display-only-some-expected.html: Removed.
      * fast/regions/counters/extract-numbered-spans-display-only-some.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-001-expected.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-001.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-002-expected.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-002.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-003-expected.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-003.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-001-expected.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-001.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-002-expected.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-002.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-003-expected.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-003.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-004-expected.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-004.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005-expected.html: Removed.
      * fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005.html: Removed.
      * fast/regions/counters/extract-unordered-lists-in-regions-expected.html: Removed.
      * fast/regions/counters/extract-unordered-lists-in-regions.html: Removed.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e5d8680b
  16. 08 Apr, 2013 2 commits
    • abucur@adobe.com's avatar
      Simplify ContainerNode::removeChildren · 24c25908
      abucur@adobe.com authored
      https://bugs.webkit.org/show_bug.cgi?id=113517
      
      Reviewed by Darin Adler.
      
      The patch is based on the work made by Elliott Sprehn. He kindly agreed
      for me to finalize the last bits and pieces of the fix.
      
      Source/WebCore:
      
      Simplify ContainerNode::removeChildren by merging the loops and removing
      willRemoveChildren. This removes two traversals of the children, avoids
      refing and derefing all the children once, avoids allocating a second
      NodeVector of children, and means we detach() in the same order as
      normal removal.
      
      This does mean you can get into an infinite loop with DOMNodeRemoved
      listeners by continously adding nodes but this is true in all other browsers
      and the current behavior is bad because it means you don't get notified
      of nodes added during removal (which other browsers do notify of). This
      patch removes the containerNode.html test that originally tested for this
      infinite loop and adds a new one that tests that all nodes get notified.
      
      This makes PerformanceTests/Parser/innerHTML-setter.html 2-6% faster.
      
      There's also a new test verifying ranges remain consistent if modified
      inside an mutation event handler. Without the patch it's possible to create
      a range with boundaries outside of the DOM tree.
      
      Tests: fast/dom/Range/range-remove-children-event.html
             fast/events/mutation-during-innerHTML.html
      
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::removeChildren):
      * dom/Document.cpp:
      * dom/Document.h: nodeChildrenWillBeRemoved is not needed any more.
      * dom/Range.cpp:
      * dom/Range.h: nodeChildrenWillBeRemoved is not needed any more.
      
      LayoutTests:
      
      Remove containerNode.html test since it was checking for an infinite
      loop when adding DOM nodes inside a DOMNodeRemoved mutation event
      handler, but we actually do want to allow an infinite loop here for
      correctness and compatability with other browsers.
      
      Also added mutation-during-innerHTML which checks that all nodes
      are notified of being removed even if they were added during the
      DOMNodeRemoved notification.
      
      There's a new test range-remove-children-event that verifies the
      ranges modified inside a mutation event handler remain consistent.
      
      * fast/dom/MutationObserver/added-out-of-order-expected.txt:
      * fast/dom/MutationObserver/added-out-of-order.html:
      * fast/dom/Range/range-remove-children-event-expected.txt: Added.
      * fast/dom/Range/range-remove-children-event.html: Added.
      * fast/dom/containerNode-expected.txt: Removed.
      * fast/dom/containerNode.html: Removed.
      * fast/events/mutation-during-innerHTML-expected.txt: Added.
      * fast/events/mutation-during-innerHTML.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147942 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      24c25908
    • zandobersek@gmail.com's avatar
      Remove WebCore::(enable|disable)SecureTextInput methods · d8a93601
      zandobersek@gmail.com authored
      https://bugs.webkit.org/show_bug.cgi?id=114126
      
      Reviewed by Alexey Proskuryakov.
      
      Remove the enableSecureTextInput and disableSecureTextInput methods and all the codepaths leading to them.
      These were used only by the Chromium port and are as such not required anymore.
      
      No new tests - no changes in functionality.
      
      * GNUmakefile.list.am:
      * WebCore.order:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/Document.cpp:
      (WebCore::Document::Document):
      * dom/Document.h:
      (Document):
      * editing/FrameSelection.cpp:
      (WebCore::FrameSelection::focusedOrActiveStateChanged):
      * editing/FrameSelection.h:
      (FrameSelection):
      * html/PasswordInputType.cpp:
      * html/PasswordInputType.h:
      (PasswordInputType):
      * page/Frame.cpp:
      (WebCore::Frame::setDocument):
      * platform/SecureTextInput.h: Removed.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d8a93601
  17. 26 Mar, 2013 2 commits
    • hayato@chromium.org's avatar
      Allow ShadowContents in HitTests by default. · af1544e8
      hayato@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=113171
      
      Reviewed by Dimitri Glazkov.
      
      Source/WebCore:
      
      HitTestRequest is widely used in WebCore, but AllowShadowContents
      flag is not turned on by default.  In most places, we can set the
      flag on.
      
      This change makes HitTests allow shadow contents by default.
      
      To track all existing HitTests which do not allow shadow contents,
      and discourage such a HitTest in the future, I've introduced
      disallowShadowContenet flag so that callers must turn on this flag
      explicitly if they want to disallow shadow contents in their HitTests.
      
      This change should be refactoring and should not include any
      behavior changes.  After this change, we'll investigate each place
      where disallowShadowContents is used step by step and get rid of
      the flag if it is okay to remove.
      
      No new tests, no behavior change.
      
      * dom/Document.h:
      (Document):
      * dom/TreeScope.cpp:
      (WebCore::nodeFromPoint):
      * editing/FrameSelection.cpp:
      (WebCore::FrameSelection::contains):
      * page/DragController.cpp:
      (WebCore::elementUnderMouse):
      (WebCore::DragController::canProcessDrag):
      (WebCore::DragController::startDrag):
      * page/EventHandler.cpp:
      (WebCore::EventHandler::handleMouseDraggedEvent):
      (WebCore::EventHandler::eventMayStartDrag):
      (WebCore::EventHandler::updateSelectionForMouseDrag):
      (WebCore::EventHandler::hitTestResultAtPoint):
      (WebCore::EventHandler::handleMousePressEvent):
      (WebCore::EventHandler::handleMouseDoubleClickEvent):
      (WebCore::EventHandler::handleMouseMoveEvent):
      (WebCore::EventHandler::handleMouseReleaseEvent):
      (WebCore::EventHandler::updateDragAndDrop):
      (WebCore::EventHandler::isInsideScrollbar):
      (WebCore::EventHandler::handleWheelEvent):
      (WebCore::EventHandler::handleGestureEvent):
      (WebCore::EventHandler::handleGestureLongPress):
      (WebCore::EventHandler::handleGestureScrollBegin):
      (WebCore::EventHandler::bestClickableNodeForTouchPoint):
      (WebCore::EventHandler::bestContextMenuNodeForTouchPoint):
      (WebCore::EventHandler::bestZoomableAreaForTouchPoint):
      (WebCore::EventHandler::sendContextMenuEvent):
      (WebCore::EventHandler::sendContextMenuEventForKey):
      (WebCore::EventHandler::hoverTimerFired):
      (WebCore::EventHandler::dragSourceEndedAt):
      (WebCore::EventHandler::handleDrag):
      (WebCore::EventHandler::handleTouchEvent):
      (WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled):
      * page/EventHandler.h:
      (EventHandler):
      * page/FocusController.cpp:
      (WebCore::updateFocusCandidateIfNeeded):
      * page/Frame.cpp:
      (WebCore::Frame::visiblePositionForPoint):
      * page/TouchDisambiguation.cpp:
      (WebCore::findGoodTouchTargets):
      * rendering/HitTestRequest.h:
      (WebCore::HitTestRequest::disallowsShadowContent):
      * rendering/HitTestResult.cpp:
      (WebCore::HitTestResult::addNodeToRectBasedTestResult):
      * rendering/RenderFlowThread.cpp:
      (WebCore::RenderFlowThread::hitTestFlowThreadPortionInRegion):
      * rendering/svg/RenderSVGResourceClipper.cpp:
      (WebCore::RenderSVGResourceClipper::hitTestClipContent):
      * testing/Internals.cpp:
      (WebCore::Internals::nodesFromRect):
      
      Source/WebKit/blackberry:
      
      * Api/WebPage.cpp:
      (BlackBerry::WebKit::WebPagePrivate::hitTestResult):
      * WebKitSupport/FatFingers.cpp:
      (BlackBerry::WebKit::FatFingers::getNodesFromRect):
      * WebKitSupport/ProximityDetector.cpp:
      (BlackBerry::WebKit::ProximityDetector::findBestPoint):
      * WebKitSupport/SelectionHandler.cpp:
      (BlackBerry::WebKit::visiblePositionForPointIgnoringClipping):
      
      Source/WebKit/chromium:
      
      * src/ContextMenuClientImpl.cpp:
      (WebKit::selectMisspelledWord):
      * src/WebFrameImpl.cpp:
      (WebKit::WebFrameImpl::visiblePositionForWindowPoint):
      * src/WebPluginContainerImpl.cpp:
      (WebKit::WebPluginContainerImpl::isRectTopmost):
      * src/WebViewImpl.cpp:
      (WebKit::WebViewImpl::computeBlockBounds):
      (WebKit::WebViewImpl::bestTapNode):
      
      Source/WebKit/efl:
      
      * ewk/ewk_frame.cpp:
      (ewk_frame_hit_test_new):
      
      Source/WebKit/gtk:
      
      * webkit/webkitwebinspector.cpp:
      (webkit_web_inspector_inspect_coordinates):
      * webkit/webkitwebview.cpp:
      (prepareMouseEventForFrame):
      (webkit_web_view_get_hit_test_result):
      
      Source/WebKit/mac:
      
      * WebView/WebFrame.mm:
      (-[WebFrame elementAtPoint:]):
      * WebView/WebHTMLView.mm:
      (-[WebHTMLView elementAtPoint:allowShadowContent:]):
      
      Source/WebKit/qt:
      
      * WebCoreSupport/QWebFrameAdapter.cpp:
      (QWebFrameAdapter::hitTestContent):
      
      Source/WebKit/win:
      
      * WebView.cpp:
      (WebView::gestureNotify):
      
      Source/WebKit2:
      
      * WebProcess/WebPage/WebFrame.cpp:
      (WebKit::WebFrame::hitTest):
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::highlightPotentialActivation):
      (WebKit::WebPage::findZoomableAreaForPoint):
      (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
      * WebProcess/WebPage/mac/WebPageMac.mm:
      (WebKit::WebPage::shouldDelayWindowOrderingEvent):
      (WebKit::WebPage::acceptsFirstMouse):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146961 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      af1544e8
    • rniwa@webkit.org's avatar
      Heap-use-after-free regression · 0330737c
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=113337
      
      Reviewed by Abhishek Arya and Alexey Proskuryakov.
      
      Source/WebCore: 
      
      Use RefPtr instead of raw pointer in m_associatedFormControls.
      
      * dom/Document.cpp:
      (WebCore::Document::didAssociateFormControlsTimerFired):
      * dom/Document.h:
      (Document):
      * loader/EmptyClients.h:
      (WebCore::EmptyChromeClient::didAssociateFormControls):
      * page/ChromeClient.h:
      (WebCore::ChromeClient::didAssociateFormControls):
      
      Source/WebKit/chromium: 
      
      * src/ChromeClientImpl.cpp:
      (WebKit::ChromeClientImpl::didAssociateFormControls):
      * src/ChromeClientImpl.h:
      (ChromeClientImpl):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0330737c
  18. 24 Mar, 2013 1 commit
    • cfleizach@apple.com's avatar
      AXObjectCache gets recreated during document tear-down. · fd65313a
      cfleizach@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=112525
      
      Reviewed by Simon Fraser.
      
      In many cases, a document's AXObjectCache was being created after the
      document had detached, which is wasteful and could potentially lead to
      crashes because the AXObjectCache has a timer and relies on its document
      to exist.
      
      This patch provides a way to get the existing AX object cache, instead of
      always creating a new one.
      It moves the accessibilityEnabled() checks into the axObjectCache retrieval
      for easier readability.
      It adds a number of ASSERTs to vieryf that only the correct (top) document is used
      for cache manipulation.
      
      * accessibility/AXObjectCache.cpp:
      (WebCore::AXObjectCache::stopCachingComputedObjectAttributes):
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::~ContainerNode):
      * dom/Document.cpp:
      (WebCore::Document::~Document):
      (WebCore::Document::clearAXObjectCache):
      (WebCore::Document::existingAXObjectCache):
      (WebCore::Document::axObjectCache):
      (WebCore::Document::setFocusedNode):
      * dom/Document.h:
      (Document):
      * dom/Element.cpp:
      (WebCore::Element::attributeChanged):
      * dom/Node.cpp:
      (WebCore::Node::~Node):
      (WebCore::Node::isEditableToAccessibility):
      (WebCore::Node::attach):
      (WebCore::Node::rootEditableElement):
      (WebCore::Node::didMoveToNewDocument):
      * editing/AppendNodeCommand.cpp:
      (WebCore::sendAXTextChangedIgnoringLineBreaks):
      * editing/DeleteFromTextNodeCommand.cpp:
      (WebCore::DeleteFromTextNodeCommand::doApply):
      (WebCore::DeleteFromTextNodeCommand::doUnapply):
      * editing/Editor.cpp:
      (WebCore::Editor::respondToChangedContents):
      (WebCore::Editor::markAndReplaceFor):
      * editing/InsertIntoTextNodeCommand.cpp:
      (WebCore::InsertIntoTextNodeCommand::doApply):
      (WebCore::InsertIntoTextNodeCommand::doUnapply):
      * editing/InsertNodeBeforeCommand.cpp:
      (WebCore::InsertNodeBeforeCommand::doApply):
      (WebCore::InsertNodeBeforeCommand::doUnapply):
      * editing/atk/FrameSelectionAtk.cpp:
      (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
      * editing/chromium/FrameSelectionChromium.cpp:
      (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
      * editing/mac/FrameSelectionMac.mm:
      (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::setChecked):
      * html/HTMLSelectElement.cpp:
      (WebCore::HTMLSelectElement::optionElementChildrenChanged):
      (WebCore::HTMLSelectElement::setRecalcListItems):
      * html/HTMLTextFormControlElement.cpp:
      (WebCore::HTMLTextFormControlElement::setInnerTextValue):
      * html/InputType.cpp:
      (WebCore::InputType::applyStep):
      * html/RangeInputType.cpp:
      (WebCore::RangeInputType::handleKeydownEvent):
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::prepareForLoadStart):
      (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
      * page/FocusController.cpp:
      (WebCore::FocusController::setInitialFocus):
      * page/Frame.cpp:
      (WebCore::Frame::disconnectOwnerElement):
      * page/FrameView.cpp:
      (WebCore::FrameView::removeFromAXObjectCache):
      (WebCore::FrameView::layout):
      (WebCore::FrameView::scrollToAnchor):
      (WebCore::FrameView::axObjectCache):
      * platform/ScrollView.cpp:
      (WebCore::ScrollView::setHasHorizontalScrollbar):
      (WebCore::ScrollView::setHasVerticalScrollbar):
      * platform/Scrollbar.cpp:
      (WebCore::Scrollbar::~Scrollbar):
      (WebCore):
      (WebCore::Scrollbar::existingAXObjectCache):
      * platform/Scrollbar.h:
      (Scrollbar):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::deleteLineBoxTree):
      (WebCore::RenderBlock::createRootInlineBox):
      (WebCore::RenderBlock::createAndAppendRootInlineBox):
      * rendering/RenderListBox.cpp:
      (WebCore::RenderListBox::selectionChanged):
      * rendering/RenderMenuList.cpp:
      (WebCore::RenderMenuList::addChild):
      (WebCore::RenderMenuList::didUpdateActiveOption):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::styleWillChange):
      (WebCore::RenderObject::willBeDestroyed):
      * rendering/RenderObjectChildList.cpp:
      (WebCore::RenderObjectChildList::removeChildNode):
      (WebCore::RenderObjectChildList::insertChildNode):
      * rendering/RenderText.cpp:
      (WebCore::RenderText::setText):
      * rendering/RenderWidget.cpp:
      (WebCore::RenderWidget::willBeDestroyed):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fd65313a
  19. 22 Mar, 2013 4 commits
    • commit-queue@webkit.org's avatar
      Add client callbacks to notify of changes of associated from controls · 8756e329
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=110375
      
      Patch by Dane Wallinga <dgwallinga@chromium.org> on 2013-03-22
      Reviewed by Ryosuke Niwa.
      
      Source/WebCore:
      
      Hook FormAssociatedElement, HTMLFormElement to notify EditorClient of form changes after a page has loaded.
      Will be used to add autofill support for ajax-y webpages. e.g if while filling out a form, new fields
      are dynamically created, autofill can know to re-query the autofill server and keep going.
      https://bugs.webkit.org/show_bug.cgi?id=110375
      
      * dom/Document.cpp:
      (WebCore::Document::Document):
      (WebCore::Document::didAssociateFormControl):
      (WebCore):
      (WebCore::Document::didAssociateFormControlsTimerFired):
      * dom/Document.h:
      (Document):
      added method didAssociateFormControl, which batches form changes
      and calls out to ChromeClient on a timer.
      * html/FormAssociatedElement.cpp:
      (WebCore::FormAssociatedElement::resetFormOwner):
      (WebCore::FormAssociatedElement::formAttributeChanged):
      (WebCore):
      * html/FormAssociatedElement.h:
      (FormAssociatedElement):
      add calls to Document::didAssociateFormControl when form changes
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::insertedInto):
      (WebCore):
      * html/HTMLFormElement.h:
      add call to Document::didAssociateFormControl
      * loader/EmptyClients.h:
      (EmptyChromeClient):
      (WebCore::EmptyChromeClient::didAssociateFormControls):
      (WebCore::EmptyChromeClient::shouldNotifyOnFormChanges):
      * page/ChromeClient.h:
      (ChromeClient):
      add new method didAssociateFormControls
      
      Source/WebKit/chromium:
      
      Implement form association methods of ChromeClient
      to inform autofill of form changes after a page has loaded
      
      * public/WebAutofillClient.h:
      (WebAutofillClient):
      (WebKit::WebAutofillClient::didAssociateInput):
      (WebKit::WebAutofillClient::didAddForm):
      (WebKit::WebAutofillClient::didAssociateFormControls):
      * src/ChromeClientImpl.cpp:
      (WebKit::ChromeClientImpl::didAssociateFormControls):
      (WebKit):
      (WebKit::ChromeClientImpl::shouldNotifyOnFormChanges):
      * src/ChromeClientImpl.h:
      (ChromeClientImpl):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8756e329
    • morrita@google.com's avatar
      Custom Elements: "readyCallback" lifecycle callback should be called. · 321d20ac
      morrita@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=112538
      
      Reviewed by Elliott Sprehn.
      
      Source/WebCore:
      
      This change allows each custom element definition to hook up its instantiation,
      namely "readyCallback" lifecycle callback.
      
      The change has two parts:
      - 1. Tracking which Element objects to be created.
      - 2. Invoking appropriate JavaScript functions, which are readyCallback(),
        before the Element object is visible from page script.
      
      For 1, CustomElementRegistry maintains list of "callback
      invocaions".  Each list item ("invocation") tracks the element
      which has a lifecycle callback to be invoked. Each invocation is
      registered when - Any custom element C++ object is instantiated.
      See changes on CustomElementConstructor.cpp.
      
      This also happens when @is attribute is set by the parser or node
      cloning routine, which can turn a non-custom element into a
      type-extended custom element. See changes on Element.cpp.
      
      For 2, CustomElementRegistry basically follows what
      MutationObserver is doing, and introduces a method called
      deliverLifecycleCallbacks(). This function flushes all pending
      callback invocations. You can think it as a dual of
      MutationObserver::deliverAllMutations().
      
      The delivery function is called places where MutationObserver's
      deliverAllMutations() is called. In addition, it is also called
      just before returning from a set of DOM APIs. For example, it is
      called just before createElement() returns, so that possibly
      created custom element becomes ready through its readyCallback().
      Such APIs get "V8DeliverCustomElementCallbacks" IDL attribute. In
      principle, APIs which can create new custom element instnaces are
      marked. See CustomElementRegistry::CallbackDeliveryScope and
      changes on CodeGeneratorV8.pm.
      
      We need this extra work because the readyCallback() needs to give
      an illusion so that JavaScript programmers feel like the
      readyCallback() callback being called just after it is created,
      instead of called on arbitrary late timing like MutationObserver
      notifications.
      
      Tests: fast/dom/custom/lifecycle-ready-createElement-recursion.html
             fast/dom/custom/lifecycle-ready-createElement-reentrancy.html
             fast/dom/custom/lifecycle-ready-creation-api.html
             fast/dom/custom/lifecycle-ready-innerHTML.html
             fast/dom/custom/lifecycle-ready-parser-only.html
             fast/dom/custom/lifecycle-ready-parser-script.html
             fast/dom/custom/lifecycle-ready-paste.html
      
      * bindings/scripts/CodeGeneratorV8.pm:
      - Hooked up CallbackDeliveryScope through V8DeliverCustomElementCallbacks attriute.
      (GenerateCustomElementInvocationScopeIfNeeded):
      (GenerateNormalAttrSetter):
      (GenerateFunction):
      * bindings/scripts/IDLAttributes.txt:
      * bindings/v8/CustomElementHelpers.cpp:
      (WebCore::CustomElementHelpers::invokeReadyCallbackIfNeeded):
      (WebCore::CustomElementHelpers::invokeReadyCallbacksIfNeeded):
      * bindings/v8/CustomElementHelpers.h:
      (CustomElementHelpers):
      * bindings/v8/V8RecursionScope.cpp: Added deliverAllLifecycleCallbacks()
      (WebCore::V8RecursionScope::didLeaveScriptContext):
      * dom/CustomElementConstructor.cpp:
      (WebCore::CustomElementConstructor::createElement):
      (WebCore::CustomElementConstructor::createElementInternal):
      * dom/CustomElementConstructor.h:
      (WebCore::CustomElementConstructor::isExtended):
      (CustomElementConstructor):
      * dom/CustomElementRegistry.cpp: Adding element tracking and invocation execution.
      (WebCore::CustomElementInvocation::CustomElementInvocation):
      (WebCore::CustomElementInvocation::~CustomElementInvocation):
      (WebCore::activeCustomElementRegistries):
      (WebCore::CustomElementRegistry::~CustomElementRegistry):
      (WebCore::CustomElementRegistry::didGiveTypeExtension):
      (WebCore::CustomElementRegistry::didCreateElement):
      (WebCore::CustomElementRegistry::activate):
      (WebCore::CustomElementRegistry::deactivate):
      (WebCore::CustomElementRegistry::deliverLifecycleCallbacks):
      (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacks):
      * dom/CustomElementRegistry.h:
      (CustomElementInvocation):
      (WebCore::CustomElementInvocation::element):
      (CallbackDeliveryScope):
      (WebCore::CustomElementRegistry::CallbackDeliveryScope::CallbackDeliveryScope):
      (WebCore::CustomElementRegistry::CallbackDeliveryScope::~CallbackDeliveryScope):
      (CustomElementRegistry):
      (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacksIfNeeded):
      * dom/Document.cpp:
      (WebCore::Document::createElement):
      (WebCore::Document::didCreateCustomElement):
      * dom/Document.h:
      (Document):
      * dom/Document.idl:
      * dom/Element.cpp:
      (WebCore::Element::attributeChangedFromParserOrByCloning): Added to catch @is attribute
      (WebCore::Element::parserSetAttributes):
      (WebCore::Element::cloneAttributesFromElement):
      * dom/Element.h:
      * dom/Node.idl:
      * dom/ShadowRoot.idl:
      * html/HTMLElement.idl:
      * html/parser/HTMLScriptRunner.cpp: Added deliverAllLifecycleCallbacks()
      (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
      (WebCore::HTMLScriptRunner::runScript):
      
      Source/WebKit/chromium:
      
      * src/WebKit.cpp: Added deliverAllLifecycleCallbacks()
      
      Source/WTF:
      
      * wtf/HashSet.h:
      (WTF::copyToVector): Generalized to let it accept variants like ListHahsSet instead of only HashSet.
      
      LayoutTests:
      
      * fast/dom/custom/lifecycle-ready-createElement-recursion-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-createElement-recursion.html: Added.
      * fast/dom/custom/lifecycle-ready-createElement-reentrancy-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-createElement-reentrancy.html: Added.
      * fast/dom/custom/lifecycle-ready-creation-api-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-creation-api.html: Added.
      * fast/dom/custom/lifecycle-ready-innerHTML-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-innerHTML.html: Added.
      * fast/dom/custom/lifecycle-ready-parser-only-expected.html: Added.
      * fast/dom/custom/lifecycle-ready-parser-only.html: Added.
      * fast/dom/custom/lifecycle-ready-parser-script-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-parser-script.html: Added.
      * fast/dom/custom/lifecycle-ready-paste-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-paste.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146583 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      321d20ac
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r146534 and r146565. · 064f0fd1
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/146534
      http://trac.webkit.org/changeset/146565
      https://bugs.webkit.org/show_bug.cgi?id=113017
      
      "r146534 caused perf regression on Chromium Linux x64"
      (Requested by yurys on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-03-22
      
      Source/WebCore:
      
      * bindings/scripts/CodeGeneratorV8.pm:
      (GenerateNormalAttrSetter):
      (GenerateOverloadedFunction):
      (GenerateFunctionCallback):
      (GenerateFunction):
      (GenerateParametersCheck):
      (GenerateSingleConstructorCallback):
      (GenerateNonStandardFunction):
      (GenerateImplementation):
      (GenerateFunctionCallString):
      * bindings/scripts/IDLAttributes.txt:
      * bindings/scripts/test/V8/V8Float64Array.cpp:
      (WebCore):
      * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
      (WebCore):
      * bindings/scripts/test/V8/V8TestEventTarget.cpp:
      (WebCore):
      * bindings/scripts/test/V8/V8TestInterface.cpp:
      (WebCore):
      * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
      (WebCore):
      * bindings/scripts/test/V8/V8TestObj.cpp:
      (WebCore):
      * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
      (WebCore):
      * bindings/scripts/test/V8/V8TestTypedefs.cpp:
      (WebCore):
      * bindings/v8/CustomElementHelpers.cpp:
      * bindings/v8/CustomElementHelpers.h:
      (WebCore):
      (CustomElementHelpers):
      * bindings/v8/V8DOMConfiguration.cpp:
      (WebCore::V8DOMConfiguration::batchConfigureCallbacks):
      (WebCore::V8DOMConfiguration::configureTemplate):
      * bindings/v8/V8DOMConfiguration.h:
      (BatchedMethod):
      (V8DOMConfiguration):
      * bindings/v8/V8RecursionScope.cpp:
      (WebCore::V8RecursionScope::didLeaveScriptContext):
      * dom/CustomElementConstructor.cpp:
      (WebCore::CustomElementConstructor::createElement):
      * dom/CustomElementConstructor.h:
      (CustomElementConstructor):
      * dom/CustomElementRegistry.cpp:
      (WebCore::CustomElementRegistry::~CustomElementRegistry):
      * dom/CustomElementRegistry.h:
      (WebCore):
      (CustomElementRegistry):
      * dom/Document.cpp:
      (WebCore::Document::createElement):
      (WebCore::Document::registerElement):
      * dom/Document.h:
      * dom/Document.idl:
      * dom/Element.cpp:
      (WebCore::Element::parserSetAttributes):
      (WebCore::Element::cloneAttributesFromElement):
      * dom/Element.h:
      * dom/Element.idl:
      * dom/Node.idl:
      * dom/ShadowRoot.idl:
      * html/HTMLElement.idl:
      * html/parser/HTMLScriptRunner.cpp:
      (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
      (WebCore::HTMLScriptRunner::runScript):
      
      Source/WebKit/chromium:
      
      * src/WebKit.cpp:
      
      Source/WTF:
      
      * wtf/HashSet.h:
      (WTF):
      (WTF::copyToVector):
      
      LayoutTests:
      
      * fast/dom/custom/lifecycle-ready-createElement-recursion-expected.txt: Removed.
      * fast/dom/custom/lifecycle-ready-createElement-recursion.html: Removed.
      * fast/dom/custom/lifecycle-ready-createElement-reentrancy-expected.txt: Removed.
      * fast/dom/custom/lifecycle-ready-createElement-reentrancy.html: Removed.
      * fast/dom/custom/lifecycle-ready-creation-api-expected.txt: Removed.
      * fast/dom/custom/lifecycle-ready-creation-api.html: Removed.
      * fast/dom/custom/lifecycle-ready-innerHTML-expected.txt: Removed.
      * fast/dom/custom/lifecycle-ready-innerHTML.html: Removed.
      * fast/dom/custom/lifecycle-ready-parser-only-expected.html: Removed.
      * fast/dom/custom/lifecycle-ready-parser-only.html: Removed.
      * fast/dom/custom/lifecycle-ready-parser-script-expected.txt: Removed.
      * fast/dom/custom/lifecycle-ready-parser-script.html: Removed.
      * fast/dom/custom/lifecycle-ready-paste-expected.txt: Removed.
      * fast/dom/custom/lifecycle-ready-paste.html: Removed.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146572 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      064f0fd1
    • morrita@google.com's avatar
      Custom Elements: "readyCallback" lifecycle callback should be called. · e5501fe8
      morrita@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=112538
      
      Reviewed by Elliott Sprehn.
      
      Source/WebCore:
      
      This change allows each custom element definition to hook up its instantiation,
      namely "readyCallback" lifecycle callback.
      
      The change has two parts:
      - 1. Tracking which Element objects to be created.
      - 2. Invoking appropriate JavaScript functions, which are readyCallback(),
        before the Element object is visible from page script.
      
      For 1, CustomElementRegistry maintains list of "callback
      invocaions".  Each list item ("invocation") tracks the element
      which has a lifecycle callback to be invoked. Each invocation is
      registered when - Any custom element C++ object is instantiated.
      See changes on CustomElementConstructor.cpp.
      
      This also happens when @is attribute is set by the parser or node
      cloning routine, which can turn a non-custom element into a
      type-extended custom element. See changes on Element.cpp.
      
      For 2, CustomElementRegistry basically follows what
      MutationObserver is doing, and introduces a method called
      deliverLifecycleCallbacks(). This function flushes all pending
      callback invocations. You can think it as a dual of
      MutationObserver::deliverAllMutations().
      
      The delivery function is called places where MutationObserver's
      deliverAllMutations() is called. In addition, it is also called
      just before returning from a set of DOM APIs. For example, it is
      called just before createElement() returns, so that possibly
      created custom element becomes ready through its readyCallback().
      Such APIs get "V8DeliverCustomElementCallbacks" IDL attribute. In
      principle, APIs which can create new custom element instnaces are
      marked. See CustomElementRegistry::CallbackDeliveryScope and
      changes on CodeGeneratorV8.pm.
      
      We need this extra work because the readyCallback() needs to give
      an illusion so that JavaScript programmers feel like the
      readyCallback() callback being called just after it is created,
      instead of called on arbitrary late timing like MutationObserver
      notifications.
      
      Tests: fast/dom/custom/lifecycle-ready-createElement-recursion.html
             fast/dom/custom/lifecycle-ready-createElement-reentrancy.html
             fast/dom/custom/lifecycle-ready-creation-api.html
             fast/dom/custom/lifecycle-ready-innerHTML.html
             fast/dom/custom/lifecycle-ready-parser-only.html
             fast/dom/custom/lifecycle-ready-parser-script.html
             fast/dom/custom/lifecycle-ready-paste.html
      
      * bindings/scripts/CodeGeneratorV8.pm:
      - Hooked up CallbackDeliveryScope through V8DeliverCustomElementCallbacks attriute.
      (GenerateCustomElementInvocationScopeIfNeeded):
      (GenerateNormalAttrSetter):
      (GenerateFunction):
      * bindings/scripts/IDLAttributes.txt:
      * bindings/v8/CustomElementHelpers.cpp:
      (WebCore::CustomElementHelpers::invokeReadyCallbackIfNeeded):
      (WebCore::CustomElementHelpers::invokeReadyCallbacksIfNeeded):
      * bindings/v8/CustomElementHelpers.h:
      (CustomElementHelpers):
      * bindings/v8/V8RecursionScope.cpp: Added deliverAllLifecycleCallbacks()
      (WebCore::V8RecursionScope::didLeaveScriptContext):
      * dom/CustomElementConstructor.cpp:
      (WebCore::CustomElementConstructor::createElement):
      (WebCore::CustomElementConstructor::createElementInternal):
      * dom/CustomElementConstructor.h:
      (WebCore::CustomElementConstructor::isExtended):
      (CustomElementConstructor):
      * dom/CustomElementRegistry.cpp: Adding element tracking and invocation execution.
      (WebCore::CustomElementInvocation::CustomElementInvocation):
      (WebCore::CustomElementInvocation::~CustomElementInvocation):
      (WebCore::activeCustomElementRegistries):
      (WebCore::CustomElementRegistry::~CustomElementRegistry):
      (WebCore::CustomElementRegistry::didGiveTypeExtension):
      (WebCore::CustomElementRegistry::didCreateElement):
      (WebCore::CustomElementRegistry::activate):
      (WebCore::CustomElementRegistry::deactivate):
      (WebCore::CustomElementRegistry::deliverLifecycleCallbacks):
      (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacks):
      * dom/CustomElementRegistry.h:
      (CustomElementInvocation):
      (WebCore::CustomElementInvocation::element):
      (CallbackDeliveryScope):
      (WebCore::CustomElementRegistry::CallbackDeliveryScope::CallbackDeliveryScope):
      (WebCore::CustomElementRegistry::CallbackDeliveryScope::~CallbackDeliveryScope):
      (CustomElementRegistry):
      (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacksIfNeeded):
      * dom/Document.cpp:
      (WebCore::Document::createElement):
      (WebCore::Document::didCreateCustomElement):
      * dom/Document.h:
      (Document):
      * dom/Document.idl:
      * dom/Element.cpp:
      (WebCore::Element::attributeChangedFromParserOrByCloning): Added to catch @is attribute
      (WebCore::Element::parserSetAttributes):
      (WebCore::Element::cloneAttributesFromElement):
      * dom/Element.h:
      * dom/Node.idl:
      * dom/ShadowRoot.idl:
      * html/HTMLElement.idl:
      * html/parser/HTMLScriptRunner.cpp: Added deliverAllLifecycleCallbacks()
      (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
      (WebCore::HTMLScriptRunner::runScript):
      
      Source/WebKit/chromium:
      
      * src/WebKit.cpp: Added deliverAllLifecycleCallbacks()
      
      Source/WTF:
      
      * wtf/HashSet.h:
      (WTF::copyToVector): Generalized to let it accept variants like ListHahsSet instead of only HashSet.
      
      LayoutTests:
      
      * fast/dom/custom/lifecycle-ready-createElement-recursion-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-createElement-recursion.html: Added.
      * fast/dom/custom/lifecycle-ready-createElement-reentrancy-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-createElement-reentrancy.html: Added.
      * fast/dom/custom/lifecycle-ready-creation-api-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-creation-api.html: Added.
      * fast/dom/custom/lifecycle-ready-innerHTML-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-innerHTML.html: Added.
      * fast/dom/custom/lifecycle-ready-parser-only-expected.html: Added.
      * fast/dom/custom/lifecycle-ready-parser-only.html: Added.
      * fast/dom/custom/lifecycle-ready-parser-script-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-parser-script.html: Added.
      * fast/dom/custom/lifecycle-ready-paste-expected.txt: Added.
      * fast/dom/custom/lifecycle-ready-paste.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e5501fe8
  20. 20 Mar, 2013 1 commit
    • mkwst@chromium.org's avatar
      CSP 1.1: Stub out SecurityPolicyViolationEvent interface. · 5bcd6dde
      mkwst@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=112681
      
      Reviewed by Adam Barth.
      
      Source/WebCore:
      
      A first pass at a SecurityPolicyViolationEvent interface is defined in
      CSP 1.1's editor's draft[1]. This patch puts the big components into
      place so that we can start getting some implementation experience with
      the new event interface as it's defined, and feed that back into the
      working group.
      
      Here, we're only defining the interface, and creating a listener on the
      Document. Events aren't yet being fired when Content Security Policy
      violations occur. I'll tackle that in a future patch; adding files is
      a big enough annoyance to do it separately.
      
      This patch has only two web-visible impacts:
      
      - Document objects now have an 'onsecuritypolicyviolation' attribute.
      - A SecurityPolicyViolationEvent constructor is accessible on the Window object.
      
      Ports that have not enabled the CSP_NEXT flag should experience no change.
      
      [1]: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#securitypolicyviolationevent-events
      
      Test: http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics.html
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
          Wow! A new file! This is so exciting! I'm going to tell ALL my build
          systems about this!
      * dom/Document.h:
      * dom/Document.idl:
          Define an 'onsecuritypolicyviolation' event handler on Document objects.
      * dom/EventNames.h:
      * dom/EventNames.in:
          Define a 'securitypolicyviolation' event type.
      * dom/SecurityPolicyViolationEvent.h: Added.
      (WebCore::SecurityPolicyViolationEventInit::SecurityPolicyViolationEventInit):
      (SecurityPolicyViolationEventInit):
      (SecurityPolicyViolationEvent):
      (WebCore::SecurityPolicyViolationEvent::create):
      (WebCore::SecurityPolicyViolationEvent::documentURI):
      (WebCore::SecurityPolicyViolationEvent::referrer):
      (WebCore::SecurityPolicyViolationEvent::blockedURI):
      (WebCore::SecurityPolicyViolationEvent::violatedDirective):
      (WebCore::SecurityPolicyViolationEvent::effectiveDirective):
      (WebCore::SecurityPolicyViolationEvent::originalPolicy):
      (WebCore::SecurityPolicyViolationEvent::sourceURL):
      (WebCore::SecurityPolicyViolationEvent::lineNumber):
      (WebCore::SecurityPolicyViolationEvent::interfaceName):
      (WebCore::SecurityPolicyViolationEvent::SecurityPolicyViolationEvent):
      * dom/SecurityPolicyViolationEvent.idl: Added.
          Define the SecurityPolicyViolationEvent's IDL, and then create all the
          boilerplate necessary to properly initialize a SecurityPolicyViolationEvent
          object with the relevant properties.
      * page/DOMWindow.idl:
          Add the new SecurityPolicyViolationEvent constructor to the Window object
          so it's available on a page.
      
      LayoutTests:
      
      * http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics-expected.txt: Added.
      * http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics.html: Added.
          Simple test which checks only that events are created correctly,
          and that the event handler exists on Document. We'll test the
          real functionality once we wire the event up to the handler.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5bcd6dde
  21. 15 Mar, 2013 1 commit
    • morrita@google.com's avatar
      [Custom Elements] Any HTMLElement subclass should become a superclass of custom element · b6d053b9
      morrita@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=110436
      
      Reviewed by Dimitri Glazkov.
      
      Source/WebCore:
      
      This change introduces "type extension" concept of custom elements.
      With the type extension, each custom elements are able to inherit
      from not only HTMLElement, but also any HTML element. To make it work,
      this change extends the plumbing.
      
      This change does following changes:
      
      = Data structure:
      
      - Let CustomElementConstructor objects being keyed by pair of (element
        name, local name) as the standard requries, instead of just using
        single name. See CustomElementRegistry::ConstructorMap and CustomElementRegistry::find().
      
      - Creates mapping from WrapperTypeInfo to element name.  This map
        can be looked-up by generated functions like
        findHTMLTagNameOfV8Type().  With this table, WebKit can determine
        the custom element local name of given prototype object. See  make_names.pl.
        Note that V8 prototype object knows associated WrapperTypeInfo. See r144865.
      
      = Hooking up element lifecyle:
      
      - Create appropriate C++ instance for each custom element.  Before
        this change, the C++ backend of custom elements were always
        HTMLUnknownElements or HTMLElement.  See
        CustomElementConstructor::createElement() and ElementFactories in
        make_names.pl.
      
      - Hooks up element construction and element wrapper creation for
        custom element "before" non-custom case instead of "after"
        that. We do this because custom element needs to
        override non-custom case when @is attribute is given for
        otherwise-non-custom elements like <div is=x-bar>.
        See make_names.pl.
      
      - Gives @is attributes to elements if needed. See setTypeExtension() call sites
        like Document::createElement(), Document::createElementtNS() and CustomElementConstructor::createElementt()
      
      Test: fast/dom/custom/document-register-type-extensions.html
      
      * bindings/scripts/CodeGeneratorV8.pm:
      (GenerateHeader):
      * bindings/scripts/test/V8/V8Float64Array.h:
      * bindings/scripts/test/V8/V8TestActiveDOMObject.h:
      * bindings/scripts/test/V8/V8TestCustomNamedGetter.h:
      * bindings/scripts/test/V8/V8TestEventConstructor.h:
      * bindings/scripts/test/V8/V8TestEventTarget.h:
      * bindings/scripts/test/V8/V8TestException.h:
      * bindings/scripts/test/V8/V8TestInterface.h:
      * bindings/scripts/test/V8/V8TestMediaQueryListListener.h:
      * bindings/scripts/test/V8/V8TestNamedConstructor.h:
      * bindings/scripts/test/V8/V8TestNode.h:
      * bindings/scripts/test/V8/V8TestObj.h:
      * bindings/scripts/test/V8/V8TestOverloadedConstructors.h:
      * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:
      * bindings/scripts/test/V8/V8TestTypedefs.h:
      * bindings/v8/CustomElementHelpers.cpp:
      (WebCore::hasValidPrototypeChain):
      (WebCore::CustomElementHelpers::isValidPrototypeParameter):
      (WebCore::CustomElementHelpers::findLocalName):
      (WebCore):
      (WebCore::CustomElementHelpers::findWrapperType):
      * bindings/v8/CustomElementHelpers.h:
      (CustomElementHelpers):
      * bindings/v8/V8CustomElement.cpp:
      (WebCore::V8CustomElement::createWrapper):
      * bindings/v8/V8CustomElement.h:
      (V8CustomElement):
      (WebCore::V8CustomElement::wrap):
      (WebCore::V8CustomElement::constructorOf):
      * bindings/v8/WrapperTypeInfo.h:
      (WrapperTypeTraits): Added.
      * bindings/v8/custom/V8CustomElementConstructorCustom.cpp:
      (WebCore::V8CustomElementConstructor::callAsFunctionCallback):
      * dom/CustomElementConstructor.cpp:
      (WebCore::CustomElementConstructor::create):
      (WebCore::CustomElementConstructor::CustomElementConstructor):
      (WebCore::CustomElementConstructor::createElement):
      (WebCore::setTypeExtension):
      * dom/CustomElementConstructor.h:
      (CustomElementConstructor):
      (WebCore::CustomElementConstructor::document):
      (WebCore::CustomElementConstructor::typeName):
      (WebCore::CustomElementConstructor::localName):
      * dom/CustomElementRegistry.cpp:
      (WebCore::nameIncludesHyphen):
      (WebCore::CustomElementRegistry::isValidName):
      (WebCore::CustomElementRegistry::registerElement):
      (WebCore::CustomElementRegistry::findFor):
      (WebCore::CustomElementRegistry::find):
      (WebCore::CustomElementRegistry::createElement):
      * dom/CustomElementRegistry.h:
      (CustomElementRegistry):
      * dom/Document.cpp:
      (WebCore::Document::createElement):
      (WebCore::Document::createElementNS):
      (WebCore::Document::registerElement):
      * dom/Document.h:
      (Document):
      (WebCore::Document::registry): Moved from Document.cpp to be inlined.
      * dom/Document.idl:
      * dom/make_names.pl:
      (printFactoryCppFile):
      (printWrapperFactoryCppFile):
      (printWrapperFactoryHeaderFile):
      * html/HTMLAttributeNames.in: Added @is attribute
      
      LayoutTests:
      
      * fast/dom/custom/document-register-basic-expected.txt:
      * fast/dom/custom/document-register-basic.html:
      * fast/dom/custom/document-register-type-extensions-expected.txt: Added.
      * fast/dom/custom/document-register-type-extensions.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b6d053b9
  22. 14 Mar, 2013 1 commit
    • jer.noble@apple.com's avatar
      Crash in DumpRenderTree at com.apple.WebCore:... · c3419e02
      jer.noble@apple.com authored
      Crash in DumpRenderTree at com.apple.WebCore: WebCore::CaptionUserPreferences::captionPreferencesChanged + 185
      https://bugs.webkit.org/show_bug.cgi?id=112051
      
      Reviewed by Eric Carlson.
      
      No new tests; fixes a crash during media/video-controls-captions-trackmenu.html.
      
      Instead of relying on a registration system which can fail when an element's document does not have a page,
      Elements will register for captionPreferencesChanged() notifications directly with their owning Document.
      CaptionUserPreferences, in turn, will notify all Documents in its PageGroup, rather than only directly
      registered listeners.
      
      * dom/Document.cpp:
      (WebCore::Document::registerForCaptionPreferencesChangedCallbacks): Added. Notify the CaptionUserPreferences that someone
          is interested in captionPreferencesChanged notfications.
      (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): Added.
      (WebCore::Document::captionPreferencesChanged): Added. Pass to all registered elements.
      * dom/Document.h:
      * dom/Element.h:
      (WebCore::Element::captionPreferencesChanged): Added. Empty; intended
          to be overridden by subclasses.
      * history/CachedPage.cpp:
      (WebCore::CachedPage::CachedPage): Initialize m_needsCaptionPreferenceChanged member.
      (WebCore::CachedPage::restore): Call captionPreferencesChanged() if necessary.
      * history/CachedPage.h:
      (WebCore::CachedPage::markForCaptionPreferencesChanged): Set the m_needsCaptionPreferenceChanged member.
      * history/PageCache.cpp:
      (WebCore::PageCache::markPagesForCaptionPreferencesChanged): Pass to every CachedPage.
      * history/PageCache.h:
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement): Register with the Document.
      (WebCore::HTMLMediaElement::~HTMLMediaElement): Unregister with same.
      (WebCore::HTMLMediaElement::attach): Remove previous registration call.
      * html/HTMLMediaElement.h:
      * page/CaptionUserPreferences.cpp:
      (WebCore::CaptionUserPreferences::captionPreferencesChanged): Pass to the
          PageGroup.
      * page/CaptionUserPreferences.h:
      (WebCore::CaptionUserPreferences::setInterestedInCaptionPreferenceChanges):
          Empty; intended to be overridden by subclasses.
      * page/CaptionUserPreferencesMac.h:
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::setInterestedInCaptionPreferenceChanges):
          Renamed from registerForPreferencesChangedCallbacks().
      (WebCore::CaptionUserPreferencesMac::captionPreferencesChanged):
          Replace call to havePreferenceChangeListeners() with m_listeningForPreferenceChanges.
      * page/Page.cpp:
      (WebCore::Page::captionPreferencesChanged):
          Pass to every contained Document.
      * page/Page.h:
      * page/CaptionUserPreferences.cpp:
      (WebCore::CaptionUserPreferences::captionPreferencesChanged): Pass to the PageGroup.
      * page/CaptionUserPreferences.h:
      * page/PageGroup.cpp:
      (WebCore::PageGroup::captionPreferencesChanged): Pass to every page, as well as pages in the PageCache.
      * page/PageGroup.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c3419e02
  23. 13 Mar, 2013 3 commits
    • commit-queue@webkit.org's avatar
      Implement FontLoader interface · d7e6fa24
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=98395
      
      Patch by Kunihiko Sakamoto <ksakamoto@chromium.org> on 2013-03-13
      Reviewed by Eric Seidel.
      
      Source/WebCore:
      
      This patch implements the FontLoader interface defined in CSS Font
      Load Events Module Level 3.[1] It adds fontloader attribute to
      Document, and adds two interfaces, FontLoader and
      CSSFontFaceLoadEvent to WebCore.
      
      [1]: http://dev.w3.org/csswg/css-font-load-events-3/
      
      This feature is guarded by FONT_LOAD_EVENTS compiler flag and
      RuntimeEnabledFeatures::fontLoadEventsEnabled() runtime flag.
      
      Tests: fast/css/fontloader-download-error.html
             fast/css/fontloader-events.html
             fast/css/fontloader-loadingdone.html
             fast/css/fontloader-multiple-faces-download-error.html
             fast/css/fontloader-multiple-faces.html
             fast/css/fontloader-multiple-families.html
             http/tests/webfont/fontloader-loading-attribute.html
      
      * CMakeLists.txt: Adding FontLoader/CSSFontFaceLoadEvent files.
      * DerivedSources.cpp: Ditto.
      * DerivedSources.make: Ditto.
      * DerivedSources.pri: Ditto.
      * GNUmakefile.list.am: Ditto.
      * Target.pri: Ditto.
      * WebCore.gypi: Ditto.
      * WebCore.vcproj/WebCore.vcproj: Ditto.
      * WebCore.vcxproj/WebCore.vcxproj: Ditto.
      * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
      * WebCore.xcodeproj/project.pbxproj: Ditto.
      * bindings/js/JSDictionary.cpp:
      (WebCore::JSDictionary::convertValue): Add convertValue() for CSSFontFaceRule, DOMError, and VoidCallback.
      * bindings/js/JSDictionary.h: Ditto.
      * bindings/v8/Dictionary.cpp: Add get() for CSSFontFaceRule, DOMError, and VoidCallback.
      (WebCore::Dictionary::get):
      * bindings/v8/Dictionary.h: Ditto.
      (Dictionary):
      * css/CSSFontFace.cpp: Notifies FontLoader as load progresses.
      (WebCore::CSSFontFace::fontLoaded):
      (WebCore::CSSFontFace::getFontData):
      (WebCore::CSSFontFace::notifyFontLoader):
      (WebCore::CSSFontFace::notifyLoadingDone):
      * css/CSSFontFace.h: Add two member variables. m_rule stores CSSFontFaceRule for the fontface. m_loadState holds current state of the fontface in terms of FontLoader.
      (WebCore::CSSFontFace::create): Takes additional parameter of type CSSFontFaceRule.
      (WebCore::CSSFontFace::loadState):
      (WebCore::CSSFontFace::CSSFontFace):
      * css/CSSFontFaceLoadEvent.cpp: Added.
      (WebCore::CSSFontFaceLoadEvent::CSSFontFaceLoadEvent):
      (WebCore::CSSFontFaceLoadEvent::~CSSFontFaceLoadEvent):
      (WebCore::CSSFontFaceLoadEvent::interfaceName):
      * css/CSSFontFaceLoadEvent.h: Added.
      (CSSFontFaceLoadEventInit):
      (CSSFontFaceLoadEvent):
      (WebCore::CSSFontFaceLoadEvent::create):
      (WebCore::CSSFontFaceLoadEvent::createForFontFaceRule):
      (WebCore::CSSFontFaceLoadEvent::createForError):
      (WebCore::CSSFontFaceLoadEvent::fontface):
      (WebCore::CSSFontFaceLoadEvent::error):
      * css/CSSFontFaceLoadEvent.idl: Added.
      * css/CSSFontFaceRule.idl: Add JSGenerateToJSObject and JSGenerateToNativeObject as JSC binding needs them.
      * css/CSSFontFaceSource.cpp:
      (WebCore::CSSFontFaceSource::isDecodeError): Added.
      (WebCore::CSSFontFaceSource::ensureFontData): Added.
      * css/CSSFontFaceSource.h:
      (CSSFontFaceSource):
      * css/CSSFontSelector.cpp:
      (WebCore::CSSFontSelector::addFontFaceRule): Pass a CSSFontFaceRule to CSSFontFace::create().
      (WebCore::CSSFontSelector::getFontData): Moved logic for creating a CSSSegmentedFontFace to a helper function getFontFace().
      (WebCore::CSSFontSelector::getFontFace): Added.
      * css/CSSFontSelector.h:
      * css/CSSSegmentedFontFace.cpp:
      (WebCore::CSSSegmentedFontFace::fontLoaded): Fires callbacks when load is completed.
      (WebCore::CSSSegmentedFontFace::isLoading): Returns true if any fonts are still loading.
      (WebCore::CSSSegmentedFontFace::checkFont): Returns true if all fonts are loaded.
      (WebCore::CSSSegmentedFontFace::loadFont): Starts load by calling getFontData().
      * css/CSSSegmentedFontFace.h:
      (CSSSegmentedFontFace): Declares new functions and a vector to store callbacks.
      (LoadFontCallback):
      (WebCore::CSSSegmentedFontFace::LoadFontCallback::~LoadFontCallback):
      * css/FontLoader.cpp: Added.
      (LoadFontCallback): Holds callback functions of FontLoader.loadFont().
      (WebCore::LoadFontCallback::create):
      (WebCore::LoadFontCallback::createFromParams):
      (WebCore::LoadFontCallback::LoadFontCallback):
      (WebCore::LoadFontCallback::notifyLoaded):
      (WebCore::LoadFontCallback::notifyError):
      (WebCore::FontLoader::FontLoader):
      (WebCore::FontLoader::~FontLoader):
      (WebCore::FontLoader::eventTargetData):
      (WebCore::FontLoader::ensureEventTargetData):
      (WebCore::FontLoader::interfaceName):
      (WebCore::FontLoader::scriptExecutionContext):
      (WebCore::FontLoader::didLayout): Fires pending events and callbacks. This is called when layout have completed.
      (WebCore::FontLoader::scheduleEvent): Defers event dispatching until layout completes.
      (WebCore::FontLoader::firePendingEvents): Dispatches pending events.
      (WebCore::FontLoader::beginFontLoading): Schedules loading/loadstart events. This is called from CSSFontFace.
      (WebCore::FontLoader::fontLoaded): Schedules load/loadingdone events. This is called from CSSFontFace.
      (WebCore::FontLoader::loadError): Schedules error/loadingdone events. This is called from CSSFontFace.
      (WebCore::FontLoader::notifyWhenFontsReady): Implements fontloader.notifyWhenFontsReady().
      (WebCore::FontLoader::loadingDone): Fires callbacks of notifyWhenFontsReady.
      (WebCore::FontLoader::loadFont): Implements fontloader.loadFont().
      (WebCore::FontLoader::checkFont): Implements fontloader.checkFont().
      (WebCore::FontLoader::resolveFontStyle): Parses the given font parameter using the syntax of CSS 'font' property and creates Font object. The logic is taken from CanvasRenderingContext2D::setFont().
      * css/FontLoader.h: Added.
      (FontLoader):
      (WebCore::FontLoader::create):
      (WebCore::FontLoader::loading):
      (WebCore::FontLoader::document):
      (WebCore::FontLoader::refEventTarget):
      (WebCore::FontLoader::derefEventTarget):
      * css/FontLoader.idl: Added.
      * dom/Document.cpp:
      (WebCore::Document::Document):
      (WebCore::Document::fontloader): Added.
      * dom/Document.h:
      (Document): Add m_fontloader and fontloader().
      * dom/Document.idl: Add fontloader attribute.
      * dom/EventNames.h: Add loading and loadingdone events.
      * dom/EventNames.in: Add CSSFontFaceLoadEvent.
      * dom/EventTargetFactory.in: Add FontLoader.
      * page/FrameView.cpp:
      (WebCore::FrameView::performPostLayoutTasks): Calls FontLoader::didLayout().
      
      Tools:
      
      Enable FontLoadEvents runtime flag for TestShell.
      
      * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp:
      (WebTestRunner::TestInterfaces::TestInterfaces):
      
      LayoutTests:
      
      Add tests for document.fontloader. Since the feature is currently enabled
      only for chromium, the tests are expected to fail on the other ports.
      
      * fast/css/fontloader-download-error-expected.txt: Added.
      * fast/css/fontloader-download-error.html: Added.
      * fast/css/fontloader-events-expected.txt: Added.
      * fast/css/fontloader-events.html: Added.
      * fast/css/fontloader-loadingdone-expected.txt: Added.
      * fast/css/fontloader-loadingdone.html: Added.
      * fast/css/fontloader-multiple-faces-download-error-expected.txt: Added.
      * fast/css/fontloader-multiple-faces-download-error.html: Added.
      * fast/css/fontloader-multiple-faces-expected.txt: Added.
      * fast/css/fontloader-multiple-faces.html: Added.
      * fast/css/fontloader-multiple-families-expected.txt: Added.
      * fast/css/fontloader-multiple-families.html: Added.
      * http/tests/webfont/fontloader-loading-attribute-expected.txt: Added.
      * http/tests/webfont/fontloader-loading-attribute.html: Added.
      * platform/chromium/fast/css/fontloader-download-error-expected.txt: Added.
      * platform/chromium/fast/css/fontloader-events-expected.txt: Added.
      * platform/chromium/fast/css/fontloader-loadingdone-expected.txt: Added.
      * platform/chromium/fast/css/fontloader-multiple-faces-download-error-expected.txt: Added.
      * platform/chromium/fast/css/fontloader-multiple-faces-expected.txt: Added.
      * platform/chromium/fast/css/fontloader-multiple-families-expected.txt: Added.
      * platform/chromium/http/tests/webfont/fontloader-loading-attribute-expected.txt: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d7e6fa24
    • commit-queue@webkit.org's avatar
      create runtime flags for CSS Compositing · 63a7cee7
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=111818
      
      Patch by Rik Cabanier <cabanier@adobe.com> on 2013-03-13
      Reviewed by Ryosuke Niwa.
      
      Source/WebCore:
      
      No new tests, no change in functionality.
      
      Added a runtime flags that enables CSS compositing
      
      * WebCore.exp.in:
      * bindings/generic/RuntimeEnabledFeatures.cpp:
      (WebCore):
      * bindings/generic/RuntimeEnabledFeatures.h:
      (RuntimeEnabledFeatures):
      (WebCore::RuntimeEnabledFeatures::setCSSCompositingEnabled):
      (WebCore::RuntimeEnabledFeatures::cssCompositingEnabled):
      * css/CSSParser.cpp:
      (WebCore::CSSParserContext::CSSParserContext):
      (WebCore::operator==):
      (WebCore::isValidKeywordPropertyAndValue):
      (WebCore::CSSParser::parseValue):
      (WebCore::CSSParser::parseFillProperty):
      (WebCore::CSSParser::cssCompositingEnabled):
      (WebCore):
      * css/CSSParser.h:
      * css/CSSParserMode.h:
      (CSSParserContext):
      * dom/Document.cpp:
      (WebCore::Document::cssCompositingEnabled):
      (WebCore):
      * dom/Document.h:
      (Document):
      
      Source/WebKit/chromium:
      
      Added a runtime flags to enable CSS compositing for chromium.
      
      * public/WebRuntimeFeatures.h:
      (WebRuntimeFeatures):
      * src/WebRuntimeFeatures.cpp:
      (WebKit::WebRuntimeFeatures::enableCSSCompositing):
      (WebKit):
      (WebKit::WebRuntimeFeatures::isCSSCompositingEnabled):
      
      Source/WebKit/mac:
      
      Added a preference to enable CSS compositing.
      
      * WebView/WebPreferenceKeysPrivate.h:
      * WebView/WebPreferences.mm:
      (+[WebPreferences initialize]):
      (-[WebPreferences cssCompositingEnabled]):
      (-[WebPreferences setCSSCompositingEnabled:]):
      * WebView/WebPreferencesPrivate.h:
      * WebView/WebView.mm:
      (-[WebView _preferencesChanged:]):
      
      Source/WebKit2:
      
      Added a preference to enable CSS compositing.
      
      * Shared/WebPreferencesStore.h:
      (WebKit):
      * WebProcess/InjectedBundle/InjectedBundle.cpp:
      (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
      (WebKit::InjectedBundle::setCSSCompositingEnabled):
      (WebKit):
      * WebProcess/InjectedBundle/InjectedBundle.h:
      (InjectedBundle):
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::updatePreferences):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      63a7cee7
    • inferno@chromium.org's avatar
      Replace static_casts with to* functions for document types. · 8da49f1e
      inferno@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=112225
      
      Reviewed by Ryosuke Niwa.
      
      Source/WebCore:
      
      to* helper functions are preferred over static_cast calls since they
      help to catch bad casts easily on the testing infrastructure.
      
      * Modules/geolocation/Geolocation.cpp:
      (WebCore::Geolocation::document):
      ....lot of files.
      
      Source/WebKit2:
      
      * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm: Remove the redundant helper.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8da49f1e
  24. 11 Mar, 2013 2 commits
    • dino@apple.com's avatar
      Plugins created during user gestures (or soon after) should not be snapshotted · d51798b3
      dino@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=111975
      
      Reviewed by Tim Horton.
      
      There are sites which create plugins in response to user actions, such as clicking
      on an image that is acting like a poster frame. In those cases we should never snapshot.
      
      There are some other sites which also create plugins in response to user actions,
      but don't necessarily create the content themselves. Instead they run some script
      that injects an iframe, and the frame loads a plugin. In order to make sure we don't
      snapshot in those cases, we're adding the concept of a blessed plugin. Anything that
      is created soon after a *handled* user gesture is not snapshotted. To do this we
      mark a timestamp in the document when we've called an event listener for a user
      gesture. The plugin element then compares its creation time with the most recent
      user action time.
      
      * dom/Document.cpp:
      (WebCore::Document::Document): Initialise new timestamp.
      (WebCore::Document::resetLastHandledUserGestureTimestamp): Sets the member variable
          to the current time.
      * dom/Document.h:
      (WebCore::Document::lastHandledUserGestureTimestamp): Getter.
      
      * dom/EventTarget.cpp:
      (WebCore::EventTarget::fireEventListeners): If there were some event listeners and
          we were processing a user gesture, then reset the timestamp in the document.
      
      * html/HTMLPlugInImageElement.cpp:
      (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Remember if we were created
          during a user gesture.
      (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Start the plugin
          if we were created during a user gesture, or if we are close enough in time
          to a listener that fired in relation to a user gesture.
      * html/HTMLPlugInImageElement.h: New private member flag indicating if we were
          in a user gesture when constructed.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d51798b3
    • falken@chromium.org's avatar
      Implement inert subtrees needed for modal <dialog> · 727cab47
      falken@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=110952
      
      Reviewed by Hajime Morrita.
      
      Source/WebCore:
      
      This changes Node::disabled() to return true when a modal dialog is
      open and the node is not in the dialog.
      
      Reusing disabled for inertness is useful because then event
      targeting and focus control automatically have the desired behavior:
      inert nodes are skipped over.
      
      Tests: fast/dom/HTMLDialogElement/closed-dialog-does-not-block-mouse-events.html
             fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html
             fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events.html
      
      * dom/Document.h:
      (WebCore::Document::activeModalDialog): Returns the topmost element in the top layer.
      Since now the only elements in the top layer are modal dialogs, it is the active modal dialog.
      * dom/Node.cpp:
      (WebCore):
      (WebCore::Node::isInert): As per the spec, a node that is not an ancestor or descendant of the modal dialog is inert.
      (WebCore::Node::disabled): Return false when inert.
      * dom/Node.h:
      * html/HTMLFormControlElement.cpp:
      (WebCore::HTMLFormControlElement::disabled): Fall back to the superclass so inert is taken into account.
      
      LayoutTests:
      
      * fast/dom/HTMLDialogElement/closed-dialog-does-not-block-mouse-events-expected.txt: Added.
      * fast/dom/HTMLDialogElement/closed-dialog-does-not-block-mouse-events.html: Added.
      * fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events-expected.txt: Added.
      * fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html: Added.
      * fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events-expected.txt: Added.
      * fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      727cab47
  25. 07 Mar, 2013 1 commit
    • mkwst@chromium.org's avatar
      Move side-effects on hover/active state out of hit-testing · dc030f2c
      mkwst@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=98168
      
      Reviewed by Julien Chaffraix.
      
      Original patch by Allan Sandfeld Jensen; I'm just tweaking things.
      
      Document::updateHoverActiveState is currently called during hit testing
      to update the hover and active states of elements effected by mouse
      movements (or their keyboard equivalents). This conflates the hit test
      algorithm itself with side-effects associated with specific use-cases.
      
      This conflation makes it very difficult to reuse the hover/active logic
      for things other than hit testing. 'mouseenter'/'mouseleave' events[1]
      are one example of a feature that would be simple to implement on top of
      this existing logic if we split it out from the hit testing path, and
      instead call it explicitly when necessary. An explicit split between
      hit testing and its side-effects will also enable us to simplify the
      logic in future patches with well-named parameters, rather than relying
      on stuffing properties into HitTestRequest.
      
      This patch drops the call to Document::updateHoverActiveState from
      RenderView::hitTest, and adjusts the three call-sites in EventHandler
      to explicitly call out to it rather than Document::updateStyleIfNeeded.
      The latter call is still necessary but has been folded into
      updateHoverActiveState, as the former is never called without calling
      the latter.
      
      [1]: http://wkbug.com/18930
      
      * dom/Document.h:
      * dom/Document.cpp:
      (WebCore::Document::updateHoverActiveState):
          First, this function must now only be called from contexts that were
          performing a read/write hit-test: the code asserts this
          precondition.
      
          Second, rather than accepting a HitTestResult, the function accepts
          an Element* from which to begin the hover/active chain changes.
      
          Third, we have to explicitly update the hover/active states for
          documents between the updated element and the top-level document.
          The hit-testing logic was taking care of this for us, now we need to
          take care of it ourselves.
      
          Fourth, call out to updateStyleIfNeeded rather than making our
          caller do so. The calls were always paired; now that's explicit.
      (WebCore::Document::prepareMouseEvent):
      * page/EventHandler.cpp:
      (WebCore::EventHandler::hitTestResultAtPoint):
      (WebCore::EventHandler::sendContextMenuEventForKey):
      (WebCore::EventHandler::hoverTimerFired):
          Call out to updateHoverActiveState rather than updateStyleIfNeeded.
      * rendering/RenderView.cpp:
      (WebCore::RenderView::hitTest):
          Drop the call to updateHoverActiveState.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dc030f2c
  26. 05 Mar, 2013 1 commit
    • morrita@google.com's avatar
      ShadowRoot needs guardRef() and guardDeref() · fd1e79f5
      morrita@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=109777
      
      Reviewed by Dimitri Glazkov.
      
      This change moves m_guardRefCount from Document to TreeScope,
      which allows ShadowRoot to be guarded by guardRef() mechanism as
      Document. After r137524, Node referes TreeScope instead of
      Document. This is natural consequence of the change: It no longer
      makes sense to guardRef() Document pointer from Node.
      
      Detail:
      
      - Document::m_guardRefCount and related funcdtions are moved to TreeScope
      - Document::removedLastRef is factored out into TreeScope::removedLastRefToScope(),
        TreeScope::dispose() and Docuent::dispose(). ShadowRoot also got its own dispose() implementation.
      - Moved guardRef() and guardDeref() calls to TreeScope and Node.
        Note that there are two "guarded" TreeScope references. One is
        Node::m_treeScope and another is TreeScope::m_parentTreeScope.
        The guarded-ref management is now encapsulated in these two classes.
      
      No new tests. Covered by existing tests.
      
      * WebCore.exp.in:
      * dom/Document.cpp:
      (WebCore::Document::Document):
      (WebCore::Document::~Document):
      (WebCore::Document::dispose): Extracted from removedLastRef()
      * dom/Document.h:
      (WebCore::Node::isTreeScope):
      (WebCore::Node::Node):
      * dom/DocumentFragment.cpp:
      (WebCore::DocumentFragment::DocumentFragment): Remove ASSERT() and move it to ...
      (WebCore::DocumentFragment::create): ... here, to allow NULL document from ShadowRoot.
      * dom/Node.cpp:
      (WebCore::Node::~Node):
      (WebCore::Node::removedLastRef):
      * dom/Node.h:
      (WebCore::Node::setTreeScope):
      * dom/Element.cpp:
      (WebCore::Element::ensureAttr): This has been wrong and is fixed in this revision since the incorrectness is unveiled by this change.
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::ShadowRoot): Passed NULL document to superclass. This aligns what Document is doing.
      (WebCore::ShadowRoot::dispose): Added.
      * dom/ShadowRoot.h:
      (ShadowRoot):
      * dom/TreeScope.cpp:
      (SameSizeAsTreeScope):
      (WebCore::TreeScope::TreeScope):
      (WebCore::TreeScope::~TreeScope):
      (WebCore::TreeScope::dispose): Added.
      (WebCore::TreeScope::setParentTreeScope):
      (WebCore::TreeScope::deletionHasBegun):
      (WebCore::TreeScope::beginDeletion):
      (WebCore::TreeScope::refCount): Added.
      * dom/TreeScope.h: Turned m_rootNode to Node* from ContainerNode* for Node::isTreeScope to be inlined.
      (WebCore::TreeScope::guardRef): Pulled up from Document.
      (WebCore::TreeScope::guardDeref): Ditto.
      (WebCore::TreeScope::hasGuardRefCount): Added to hide m_guardRefCount.
      (WebCore::TreeScope::deletionHasBegun): Added.
      (WebCore::TreeScope::beginDeletion): Added.
      (WebCore::TreeScope::removedLastRefToScope): Pulled up from Document.
      * dom/TreeScopeAdopter.cpp:
      (WebCore::TreeScopeAdopter::moveTreeToNewScope):
      (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fd1e79f5
  27. 04 Mar, 2013 1 commit
    • commit-queue@webkit.org's avatar
      <link rel="apple-touch-icon"> tag is not honored on CNN.com, workflowy.com etc · acbaff4b
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=109061
      
      Patch by Ruslan Abdikeev <aruslan@chromium.org> on 2013-03-04
      Reviewed by Adam Barth.
      
      .:
      
      * Source/autotools/symbols.filter:
      
      Source/WebCore:
      
      Test: fast/dom/icon-url-list-apple-touch.html
      
      Added iconTypes parameter to Document::iconURLs().
      Added Document::shortcutIconURLs() with original semantics of iconURLs().
      Fixed IconController.cpp to provide iconTypesMask to iconURLs().
      Renamed iconTypes to iconTypesMask to make the meaning clearer.
      
      * WebCore.exp.in:
      * dom/Document.cpp:
      (WebCore::Document::shortcutIconURLs):
      (WebCore):
      (WebCore::Document::iconURLs):
      * dom/Document.h:
      (Document):
      * loader/icon/IconController.cpp:
      (WebCore::IconController::iconURL):
      (WebCore::IconController::urlsForTypes):
      * testing/Internals.cpp:
      (WebCore::Internals::iconURLs):
      (WebCore::Internals::shortcutIconURLs):
      (WebCore):
      (WebCore::Internals::allIconURLs):
      * testing/Internals.h:
      * testing/Internals.idl:
      
      LayoutTests:
      
      Added test for apple-touch-icon in allIconURLs().
      Changed iconURLs() to shortcutIconURLs().
      
      * fast/dom/icon-url-change.html:
      * fast/dom/icon-url-list-apple-touch-expected.txt: Added.
      * fast/dom/icon-url-list-apple-touch.html: Added.
      * fast/dom/icon-url-list.html:
      * fast/dom/icon-url-property.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      acbaff4b
  28. 03 Mar, 2013 2 commits
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r144567. · ee29c058
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/144567
      https://bugs.webkit.org/show_bug.cgi?id=111266
      
      Does not compile on apple-win (Requested by abarth on
      #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-03-03
      
      .:
      
      * Source/autotools/symbols.filter:
      
      Source/WebCore:
      
      * WebCore.exp.in:
      * dom/Document.cpp:
      (WebCore::Document::iconURLs):
      * dom/Document.h:
      (Document):
      * loader/icon/IconController.cpp:
      (WebCore::IconController::iconURL):
      (WebCore::IconController::urlsForTypes):
      * loader/icon/IconController.h:
      (IconController):
      * testing/Internals.cpp:
      (WebCore::Internals::iconURLs):
      * testing/Internals.h:
      * testing/Internals.idl:
      
      Source/WebKit:
      
      * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
      
      Source/WebKit/chromium:
      
      * public/WebFrame.h:
      * src/WebFrameImpl.cpp:
      (WebKit::WebFrameImpl::iconURLs):
      * src/WebFrameImpl.h:
      (WebFrameImpl):
      
      Source/WebKit/win:
      
      * WebKit.vcproj/WebKitExports.def.in:
      
      LayoutTests:
      
      * fast/dom/icon-url-change.html:
      * fast/dom/icon-url-list-apple-touch-expected.txt: Removed.
      * fast/dom/icon-url-list-apple-touch.html: Removed.
      * fast/dom/icon-url-list.html:
      * fast/dom/icon-url-property.html:
      * platform/chromium-android/fast/dom/icon-url-list-apple-touch-expected.txt: Removed.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144572 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ee29c058
    • commit-queue@webkit.org's avatar
      <link rel="apple-touch-icon"> tag is not honored on CNN.com, workflowy.com etc · 2d6eecc6
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=109061
      
      Patch by Ruslan Abdikeev <aruslan@chromium.org> on 2013-03-03
      Reviewed by Adam Barth.
      
      .:
      
      * Source/autotools/symbols.filter:
      
      Source/WebCore:
      
      Test: fast/dom/icon-url-list-apple-touch.html
      
      Added iconTypes parameter to Document::iconURLs().
      Added Document::shortcutIconURLs() with original semantics of iconURLs().
      Fixed IconController.cpp to provide iconTypesMask to iconURLs().
      Renamed iconTypes to iconTypesMask to make the meaning clearer.
      
      * WebCore.exp.in:
      * dom/Document.cpp:
      (WebCore::Document::shortcutIconURLs):
      (WebCore):
      (WebCore::Document::iconURLs):
      * dom/Document.h:
      (Document):
      * loader/icon/IconController.cpp:
      (WebCore::IconController::iconURL):
      (WebCore::IconController::urlsForTypes):
      * testing/Internals.cpp:
      (WebCore::Internals::iconURLs):
      (WebCore::Internals::shortcutIconURLs):
      (WebCore):
      (WebCore::Internals::allIconURLs):
      * testing/Internals.h:
      * testing/Internals.idl:
      
      LayoutTests:
      
      Added test for apple-touch-icon in allIconURLs().
      Changed iconURLs() to shortcutIconURLs().
      
      * fast/dom/icon-url-change.html:
      * fast/dom/icon-url-list-apple-touch-expected.txt: Added.
      * fast/dom/icon-url-list-apple-touch.html: Added.
      * fast/dom/icon-url-list.html:
      * fast/dom/icon-url-property.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2d6eecc6
  29. 25 Feb, 2013 1 commit