1. 23 Jan, 2012 1 commit
  2. 19 Jan, 2012 1 commit
  3. 16 Jan, 2012 1 commit
  4. 12 Jan, 2012 3 commits
    • antti@apple.com's avatar
      REGRESSION(r104060): Setting user stylesheet may leave CSSStyleSelector with stale rule pointers · 03962279
      antti@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=76191
      
      Source/WebCore: 
      
      Reviewed by Andreas Kling.
              
      Setting the user style sheet frees the existing user style sheet data structures. The code
      in Document::updatePageGroupUserSheets then relies on styleSelectorChanged to clear the
      style selector so it is not left with stale pointers. However under certain conditions
      involving pending stylesheets it may bail out quickly without clearing.
              
      Document::styleSelectorChanged has to take care that it never leaves the style selector stale
      even when bailing out early.
      
      Test: fast/css/user-stylesheet-crash.html
      
      * dom/Document.cpp:
      (WebCore::Document::styleSelectorChanged):
      
      LayoutTests: 
      
      Reviewed by Andreas Kling.
      
      * fast/css/user-stylesheet-crash-expected.txt: Added.
      * fast/css/user-stylesheet-crash.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104845 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      03962279
    • jer.noble@apple.com's avatar
      Emit an error event when a request to enter full-screen is rejected. · d20c4645
      jer.noble@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=62320
      
      Reviewed by Eric Carlson.
      
      Source/WebCore:
      
      Tests: fullscreen/full-screen-request-rejected.html
             fullscreen/full-screen-request-removed.html
      
      When a request to enter full-screen is rejected, emit an event
      (webkitfullscreenerror) in response.  But emit the event during the next
      trip through the run-loop, like the webkitfullscreenchange event, and so a new
      timer and queue are necessary.
      
      * dom/Document.cpp:
      (WebCore::Document::requestFullScreenForElement): Emit the error event
          if the request does not pass all our requirements.
      * dom/Document.h: Add new ivars.
      * dom/Document.idl: Add support for setting an onfullscreenerror attribute.
      * dom/Element.h: Ditto.
      * dom/Element.idl: Ditto.
      * dom/EventNames.h: Add the name for the error event.
      
      LayoutTests:
      
      * fullscreen/full-screen-iframe-not-allowed-expected.txt:
      * fullscreen/full-screen-iframe-not-allowed.html:
      * fullscreen/full-screen-request-rejected-expected.txt: Added.
      * fullscreen/full-screen-request-rejected.html: Added.
      * fullscreen/full-screen-request-removed-expected: Added.
      * fullscreen/full-screen-request-removed.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d20c4645
    • vsevik@chromium.org's avatar
      Make default console messages line numbers consistent. · 0c3bdd92
      vsevik@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=74075
      
      Reviewed by Pavel Feldman.
      
      Source/WebCore:
      
      Added default values for Console::addMessage sourceURL, lineNumber and
      callStack parameters, moved lineNumber after sourceURL.
      Made virtual method ScriptExecutionContext::addMessage private
      Added default values to ScriptExecutionContext::AddConsoleMessage sourceURL, lineNumber and
      callStack parameters, moved lineNumber after sourceURL.
      Reorder ScriptExecutionContext::logExceptionToConsole parameters, move lineNumber after sourceURL.
      Reordered sourceURL and lineNumber parameters in inspector methods.
      Made all calls to Console::addMessage() pass 0 as lineNumber by default (i.e. when line number is unknown / irrelevant).
      Unset line numbers are not printed to console in QT now.
      
      * bindings/js/JSCustomXPathNSResolver.cpp:
      (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
      * bindings/v8/custom/V8CustomXPathNSResolver.cpp:
      (WebCore::V8CustomXPathNSResolver::lookupNamespaceURI):
      * dom/Document.cpp:
      (WebCore::Document::logExceptionToConsole):
      (WebCore::Document::addMessage):
      * dom/Document.h:
      * dom/ScriptExecutionContext.cpp:
      (WebCore::ScriptExecutionContext::AddConsoleMessageTask::performTask):
      (WebCore::ScriptExecutionContext::reportException):
      (WebCore::ScriptExecutionContext::addConsoleMessage):
      * dom/ScriptExecutionContext.h:
      * dom/UIEvent.cpp:
      (WebCore::UIEvent::warnDeprecatedLayerXYUsage):
      * dom/ViewportArguments.cpp:
      (WebCore::reportViewportWarning):
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::validateInteractively):
      * html/canvas/WebGLRenderingContext.cpp:
      (WebCore::WebGLRenderingContext::printWarningToConsole):
      * inspector/ConsoleMessage.cpp:
      (WebCore::ConsoleMessage::ConsoleMessage):
      * inspector/ConsoleMessage.h:
      * inspector/InspectorConsoleAgent.cpp:
      (WebCore::InspectorConsoleAgent::enable):
      (WebCore::InspectorConsoleAgent::addMessageToConsole):
      (WebCore::InspectorConsoleAgent::stopTiming):
      (WebCore::InspectorConsoleAgent::count):
      (WebCore::InspectorConsoleAgent::resourceRetrievedByXMLHttpRequest):
      * inspector/InspectorConsoleAgent.h:
      * inspector/InspectorConsoleInstrumentation.h:
      (WebCore::InspectorInstrumentation::addMessageToConsole):
      * inspector/InspectorInstrumentation.cpp:
      (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
      * inspector/InspectorInstrumentation.h:
      * inspector/InspectorProfilerAgent.cpp:
      (WebCore::InspectorProfilerAgent::addProfileFinishedMessageToConsole):
      (WebCore::InspectorProfilerAgent::addStartProfilingMessageToConsole):
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::checkIfDisplayInsecureContent):
      (WebCore::FrameLoader::checkIfRunInsecureContent):
      (WebCore::FrameLoader::reportLocalLoadFailed):
      (WebCore::FrameLoader::shouldAllowNavigation):
      * loader/MainResourceLoader.cpp:
      (WebCore::MainResourceLoader::didReceiveResponse):
      * loader/appcache/ApplicationCacheGroup.cpp:
      (WebCore::ApplicationCacheGroup::didReceiveResponse):
      (WebCore::ApplicationCacheGroup::didFinishLoading):
      (WebCore::ApplicationCacheGroup::didFail):
      (WebCore::ApplicationCacheGroup::didReceiveManifestResponse):
      (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
      (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
      * loader/cache/CachedResourceLoader.cpp:
      (WebCore::CachedResourceLoader::printAccessDeniedMessage):
      * page/Console.cpp:
      (WebCore::Console::addMessage):
      (WebCore::Console::groupEnd):
      * page/Console.h:
      * page/DOMWindow.cpp:
      (WebCore::DOMWindow::postMessageTimerFired):
      (WebCore::DOMWindow::printErrorMessage):
      * storage/AbstractDatabase.cpp:
      (WebCore::AbstractDatabase::logErrorMessage):
      * svg/SVGDocumentExtensions.cpp:
      (WebCore::reportMessage):
      * websockets/WebSocket.cpp:
      (WebCore::WebSocket::connect):
      * websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::fail):
      (WebCore::WebSocketChannel::didFailSocketStream):
      * workers/DefaultSharedWorkerRepository.cpp:
      (WebCore::postConsoleMessageTask):
      (WebCore::SharedWorkerProxy::postConsoleMessageToWorkerObject):
      * workers/SharedWorkerContext.cpp:
      (WebCore::SharedWorkerContext::logExceptionToConsole):
      * workers/SharedWorkerContext.h:
      * workers/WorkerContext.cpp:
      (WebCore::WorkerContext::logExceptionToConsole):
      (WebCore::WorkerContext::addMessage):
      (WebCore::WorkerContext::addMessageToWorkerConsole):
      * workers/WorkerContext.h:
      * workers/WorkerMessagingProxy.cpp:
      (WebCore::postConsoleMessageTask):
      * xml/XSLTProcessorLibxslt.cpp:
      (WebCore::XSLTProcessor::parseErrorFunc):
      * xml/XSLTProcessorQt.cpp:
      (WebCore::XSLTMessageHandler::handleMessage):
      
      Source/WebKit/chromium:
      
      Unset line numbers are not printed to console now.
      
      * src/WebFrameImpl.cpp:
      (WebKit::WebFrameImpl::addMessageToConsole):
      
      Source/WebKit/qt:
      
      Unset line numbers are not printed to console now.
      
      * Api/qwebpage.cpp:
      (QWebPage::javaScriptConsoleMessage):
      
      Tools:
      
      Unset line numbers are not printed to console now.
      Added Source/WebCore/inspector to efl DumpRenderTree include path.
      
      * DumpRenderTree/chromium/WebViewHost.cpp:
      (WebViewHost::didAddMessageToConsole):
      * DumpRenderTree/efl/CMakeLists.txt:
      * DumpRenderTree/efl/DumpRenderTreeView.cpp:
      (onConsoleMessage):
      * DumpRenderTree/gtk/DumpRenderTree.cpp:
      (webViewConsoleMessage):
      * DumpRenderTree/mac/UIDelegate.mm:
      (-[UIDelegate webView:addMessageToConsole:withSource:]):
      * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
      (WebCore::WebPage::javaScriptConsoleMessage):
      * DumpRenderTree/win/UIDelegate.cpp:
      (UIDelegate::webViewAddMessageToConsole):
      * DumpRenderTree/wx/DumpRenderTreeWx.cpp:
      (LayoutWebViewEventHandler::OnConsoleMessageEvent):
      
      LayoutTests:
      
      Removed unset line numbers in console messages from test expectations.
      
      * fast/canvas/svg-taint-expected.txt:
      * fast/dom/Window/window-xy-properties-expected.txt:
      * fast/events/init-events-expected.txt:
      * fast/events/mouse-relative-position-expected.txt:
      * fast/events/mouseclick-target-and-positioning-expected.txt:
      * fast/events/simulated-click-coords-expected.txt:
      * fast/forms/interactive-validation-prevented-expected.txt:
      * fast/workers/storage/open-database-creation-callback-sync-expected.txt:
      * fast/workers/storage/open-database-set-empty-version-sync-expected.txt:
      * fast/xmlhttprequest/xmlhttprequest-no-file-access-expected.txt:
      * fast/xmlhttprequest/xmlhttprequest-responsetype-before-open-sync-request-expected.txt:
      * fast/xmlhttprequest/xmlhttprequest-responsetype-sync-request-expected.txt:
      * fast/xpath/nsresolver-bad-object-expected.txt:
      * http/tests/appcache/local-content-expected.txt:
      * http/tests/canvas/philip/tests/security.drawImage.canvas-expected.txt:
      * http/tests/canvas/philip/tests/security.drawImage.image-expected.txt:
      * http/tests/canvas/philip/tests/security.pattern.canvas.fillStyle-expected.txt:
      * http/tests/canvas/philip/tests/security.pattern.canvas.strokeStyle-expected.txt:
      * http/tests/canvas/philip/tests/security.pattern.cross-expected.txt:
      * http/tests/canvas/philip/tests/security.pattern.image.fillStyle-expected.txt:
      * http/tests/canvas/philip/tests/security.pattern.image.strokeStyle-expected.txt:
      * http/tests/eventsource/eventsource-bad-mime-type-expected.txt:
      * http/tests/eventsource/eventsource-content-type-charset-expected.txt:
      * http/tests/history/cross-origin-replace-history-object-expected.txt:
      * http/tests/inspector/console-xhr-logging-expected.txt:
      * http/tests/inspector/network-preflight-options-expected.txt:
      * http/tests/inspector/network/x-frame-options-deny-expected.txt:
      * http/tests/misc/bubble-drag-events-expected.txt:
      * http/tests/misc/drag-over-iframe-invalid-source-crash-expected.txt:
      * http/tests/misc/iframe-invalid-source-crash-expected.txt:
      * http/tests/misc/image-blocked-src-change-expected.txt:
      * http/tests/misc/image-blocked-src-no-change-expected.txt:
      * http/tests/misc/unloadable-script-expected.txt:
      * http/tests/plugins/cross-frame-object-access-expected.txt:
      * http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt:
      * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
      * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
      * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:
      * http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt:
      * http/tests/security/aboutBlank/xss-DENIED-navigate-opener-document-write-expected.txt:
      * http/tests/security/aboutBlank/xss-DENIED-navigate-opener-javascript-url-expected.txt:
      * http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt:
      * http/tests/security/canvas-remote-read-data-url-svg-image-expected.txt:
      * http/tests/security/canvas-remote-read-redirect-to-remote-image-expected.txt:
      * http/tests/security/canvas-remote-read-remote-image-blocked-no-crossorigin-expected.txt:
      * http/tests/security/canvas-remote-read-remote-image-blocked-then-allowed-expected.txt:
      * http/tests/security/canvas-remote-read-remote-image-expected.txt:
      * http/tests/security/canvas-remote-read-remote-image-redirect-expected.txt:
      * http/tests/security/canvas-remote-read-svg-image-expected.txt:
      * http/tests/security/contentSecurityPolicy/block-mixed-content-hides-warning-expected.txt:
      * http/tests/security/contentSecurityPolicy/connect-src-eventsource-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/connect-src-websocket-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/default-src-inline-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/directive-parsing-01-expected.txt:
      * http/tests/security/contentSecurityPolicy/directive-parsing-02-expected.txt:
      * http/tests/security/contentSecurityPolicy/directive-parsing-03-expected.txt:
      * http/tests/security/contentSecurityPolicy/eval-scripts-setInterval-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/eval-scripts-setTimeout-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/frame-src-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/image-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/inline-script-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/inline-script-blocked-goofy-expected.txt:
      * http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt:
      * http/tests/security/contentSecurityPolicy/inline-style-attribute-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/inline-style-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/javascript-url-allowed-expected.txt:
      * http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/media-src-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/object-src-no-url-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/report-only-expected.txt:
      * http/tests/security/contentSecurityPolicy/report-only-from-header-expected.txt:
      * http/tests/security/contentSecurityPolicy/report-uri-expected.txt:
      * http/tests/security/contentSecurityPolicy/report-uri-from-child-frame-expected.txt:
      * http/tests/security/contentSecurityPolicy/script-loads-with-img-src-expected.txt:
      * http/tests/security/contentSecurityPolicy/script-src-in-iframe-expected.txt:
      * http/tests/security/contentSecurityPolicy/script-src-none-expected.txt:
      * http/tests/security/contentSecurityPolicy/script-src-none-inline-event-expected.txt:
      * http/tests/security/contentSecurityPolicy/script-src-redirect-expected.txt:
      * http/tests/security/contentSecurityPolicy/script-src-self-blocked-01-expected.txt:
      * http/tests/security/contentSecurityPolicy/script-src-self-blocked-02-expected.txt:
      * http/tests/security/contentSecurityPolicy/script-src-self-blocked-03-expected.txt:
      * http/tests/security/contentSecurityPolicy/source-list-parsing-expected.txt:
      * http/tests/security/contentSecurityPolicy/style-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/worker-connect-src-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/worker-script-src-expected.txt:
      * http/tests/security/contentSecurityPolicy/xsl-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/xsl-img-blocked-expected.txt:
      * http/tests/security/contentSecurityPolicy/xsl-unaffected-by-style-src-1-expected.txt:
      * http/tests/security/cross-frame-access-call-expected.txt:
      * http/tests/security/cross-frame-access-callback-explicit-domain-DENY-expected.txt:
      * http/tests/security/cross-frame-access-child-explicit-domain-expected.txt:
      * http/tests/security/cross-frame-access-custom-expected.txt:
      * http/tests/security/cross-frame-access-delete-expected.txt:
      * http/tests/security/cross-frame-access-enumeration-expected.txt:
      * http/tests/security/cross-frame-access-first-time-expected.txt:
      * http/tests/security/cross-frame-access-get-custom-property-cached-expected.txt:
      * http/tests/security/cross-frame-access-get-expected.txt:
      * http/tests/security/cross-frame-access-history-get-expected.txt:
      * http/tests/security/cross-frame-access-history-put-expected.txt:
      * http/tests/security/cross-frame-access-location-get-expected.txt:
      * http/tests/security/cross-frame-access-location-put-expected.txt:
      * http/tests/security/cross-frame-access-name-getter-expected.txt:
      * http/tests/security/cross-frame-access-object-getPrototypeOf-expected.txt:
      * http/tests/security/cross-frame-access-object-prototype-expected.txt:
      * http/tests/security/cross-frame-access-parent-explicit-domain-expected.txt:
      * http/tests/security/cross-frame-access-port-expected.txt:
      * http/tests/security/cross-frame-access-protocol-expected.txt:
      * http/tests/security/cross-frame-access-protocol-explicit-domain-expected.txt:
      * http/tests/security/cross-frame-access-selection-expected.txt:
      * http/tests/security/cross-origin-xsl-BLOCKED-expected.txt:
      * http/tests/security/cross-origin-xsl-redirect-BLOCKED-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-subframe-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-window-open-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-2-level-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-to-data-url-sub-frame-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-from-data-url-to-data-url-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-to-data-url-from-data-url-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-subframe-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-subframe-location-change-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-window-open-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-2-level-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-uppercase-expected.txt:
      * http/tests/security/dataURL/xss-DENIED-to-data-url-window-open-expected.txt:
      * http/tests/security/filesystem-iframe-from-remote-expected.txt:
      * http/tests/security/frame-loading-via-document-write-expected.txt:
      * http/tests/security/frameNavigation/not-opener-expected.txt:
      * http/tests/security/frameNavigation/xss-DENIED-plugin-navigation-expected.txt:
      * http/tests/security/frameNavigation/xss-DENIED-targeted-link-navigation-expected.txt:
      * http/tests/security/img-with-failed-cors-check-fails-to-load-expected.txt:
      * http/tests/security/isolatedWorld/cross-origin-xhr-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-getAttribute-value-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-htmldom-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttribute-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNS-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNode-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNodeNS-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-getAttribute-value-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-htmldom-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttribute-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNS-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNode-expected.txt:
      * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNodeNS-expected.txt:
      * http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-subframe-expected.txt:
      * http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open-expected.txt:
      * http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-subframe-expected.txt:
      * http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-window-open-expected.txt:
      * http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener-expected.txt:
      * http/tests/security/listener/xss-JSTargetNode-onclick-shortcut-expected.txt:
      * http/tests/security/listener/xss-XMLHttpRequest-addEventListener-expected.txt:
      * http/tests/security/listener/xss-XMLHttpRequest-shortcut-expected.txt:
      * http/tests/security/listener/xss-window-onclick-addEventListener-expected.txt:
      * http/tests/security/listener/xss-window-onclick-shortcut-expected.txt:
      * http/tests/security/local-CSS-from-remote-expected.txt:
      * http/tests/security/local-JavaScript-from-remote-expected.txt:
      * http/tests/security/local-iFrame-from-remote-expected.txt:
      * http/tests/security/local-image-from-remote-expected.txt:
      * http/tests/security/local-video-poster-from-remote-expected.txt:
      * http/tests/security/local-video-source-from-remote-expected.txt:
      * http/tests/security/local-video-src-from-remote-expected.txt:
      * http/tests/security/mixedContent/insecure-css-in-iframe-expected.txt:
      * http/tests/security/mixedContent/insecure-css-in-main-frame-expected.txt:
      * http/tests/security/mixedContent/insecure-iframe-in-main-frame-expected.txt:
      * http/tests/security/mixedContent/insecure-image-in-main-frame-expected.txt:
      * http/tests/security/mixedContent/insecure-script-in-iframe-expected.txt:
      * http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame-expected.txt:
      * http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt:
      * http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame-expected.txt:
      * http/tests/security/mixedContent/redirect-https-to-http-script-in-iframe-expected.txt:
      * http/tests/security/postMessage/invalid-origin-throws-exception-expected.txt:
      * http/tests/security/postMessage/target-origin-expected.txt:
      * http/tests/security/redirect-BLOCKED-to-localURL-expected.txt:
      * http/tests/security/sandboxed-iframe-modify-self-expected.txt:
      * http/tests/security/sandboxed-iframe-origin-add-expected.txt:
      * http/tests/security/sandboxed-iframe-origin-remove-expected.txt:
      * http/tests/security/text-track-crossorigin-expected.txt:
      * http/tests/security/view-source-no-javascript-url-expected.txt:
      * http/tests/security/xss-DENIED-assign-location-hash-expected.txt:
      * http/tests/security/xss-DENIED-assign-location-host-expected.txt:
      * http/tests/security/xss-DENIED-assign-location-hostname-expected.txt:
      * http/tests/security/xss-DENIED-assign-location-href-javascript-expected.txt:
      * http/tests/security/xss-DENIED-assign-location-nonstandardProperty-expected.txt:
      * http/tests/security/xss-DENIED-assign-location-pathname-expected.txt:
      * http/tests/security/xss-DENIED-assign-location-protocol-expected.txt:
      * http/tests/security/xss-DENIED-assign-location-reload-expected.txt:
      * http/tests/security/xss-DENIED-assign-location-search-expected.txt:
      * http/tests/security/xss-DENIED-document-baseURI-javascript-expected.txt:
      * http/tests/security/xss-DENIED-document-baseURI-javascript-with-spaces-expected.txt:
      * http/tests/security/xss-DENIED-frame-name-expected.txt:
      * http/tests/security/xss-DENIED-getSVGDocument-iframe-expected.txt:
      * http/tests/security/xss-DENIED-getSVGDocument-object-expected.txt:
      * http/tests/security/xss-DENIED-htmlelelment-with-iframe-proto-expected.txt:
      * http/tests/security/xss-DENIED-iframe-src-alias-expected.txt:
      * http/tests/security/xss-DENIED-invalid-domain-change-expected.txt:
      * http/tests/security/xss-DENIED-javascript-with-spaces-expected.txt:
      * http/tests/security/xss-DENIED-method-with-iframe-proto-expected.txt:
      * http/tests/security/xss-DENIED-sandboxed-iframe-expected.txt:
      * http/tests/security/xss-DENIED-synchronous-form-expected.txt:
      * http/tests/security/xss-DENIED-synchronous-frame-load-in-javascript-url-expected.txt:
      * http/tests/security/xss-DENIED-window-open-javascript-url-expected.txt:
      * http/tests/security/xss-DENIED-window-open-javascript-url-with-spaces-expected.txt:
      * http/tests/security/xss-DENIED-window-open-parent-expected.txt:
      * http/tests/security/xss-DENIED-xml-external-entity-expected.txt:
      * http/tests/security/xss-DENIED-xsl-document-expected.txt:
      * http/tests/security/xss-DENIED-xsl-document-securityOrigin-expected.txt:
      * http/tests/security/xss-DENIED-xsl-external-entity-expected.txt:
      * http/tests/security/xssAuditor/anchor-url-dom-write-location-expected.txt:
      * http/tests/security/xssAuditor/anchor-url-dom-write-location-inline-event-expected.txt:
      * http/tests/security/xssAuditor/anchor-url-dom-write-location-inline-event-null-char-expected.txt:
      * http/tests/security/xssAuditor/anchor-url-dom-write-location-javascript-URL-expected.txt:
      * http/tests/security/xssAuditor/anchor-url-dom-write-location2-expected.txt:
      * http/tests/security/xssAuditor/base-href-control-char-expected.txt:
      * http/tests/security/xssAuditor/base-href-expected.txt:
      * http/tests/security/xssAuditor/base-href-null-char-expected.txt:
      * http/tests/security/xssAuditor/base-href-scheme-relative-expected.txt:
      * http/tests/security/xssAuditor/cookie-injection-expected.txt:
      * http/tests/security/xssAuditor/dom-write-URL-expected.txt:
      * http/tests/security/xssAuditor/dom-write-location-expected.txt:
      * http/tests/security/xssAuditor/dom-write-location-inline-event-expected.txt:
      * http/tests/security/xssAuditor/dom-write-location-javascript-URL-expected.txt:
      * http/tests/security/xssAuditor/embed-tag-code-attribute-2-expected.txt:
      * http/tests/security/xssAuditor/embed-tag-code-attribute-expected.txt:
      * http/tests/security/xssAuditor/embed-tag-control-char-expected.txt:
      * http/tests/security/xssAuditor/embed-tag-expected.txt:
      * http/tests/security/xssAuditor/embed-tag-javascript-url-expected.txt:
      * http/tests/security/xssAuditor/embed-tag-null-char-expected.txt:
      * http/tests/security/xssAuditor/form-action-expected.txt:
      * http/tests/security/xssAuditor/full-block-base-href-expected.txt:
      * http/tests/security/xssAuditor/full-block-get-from-iframe-expected.txt:
      * http/tests/security/xssAuditor/full-block-iframe-javascript-url-expected.txt:
      * http/tests/security/xssAuditor/full-block-iframe-no-inherit-expected.txt:
      * http/tests/security/xssAuditor/full-block-javascript-link-expected.txt:
      * http/tests/security/xssAuditor/full-block-link-onclick-expected.txt:
      * http/tests/security/xssAuditor/full-block-object-tag-expected.txt:
      * http/tests/security/xssAuditor/full-block-post-from-iframe-expected.txt:
      * http/tests/security/xssAuditor/full-block-script-tag-expected.txt:
      * http/tests/security/xssAuditor/full-block-script-tag-with-source-expected.txt:
      * http/tests/security/xssAuditor/get-from-iframe-expected.txt:
      * http/tests/security/xssAuditor/iframe-injection-expected.txt:
      * http/tests/security/xssAuditor/iframe-javascript-url-expected.txt:
      * http/tests/security/xssAuditor/iframe-javascript-url-more-encoding-expected.txt:
      * http/tests/security/xssAuditor/iframe-javascript-url-twice-url-encode-expected.txt:
      * http/tests/security/xssAuditor/iframe-javascript-url-twice-url-encode2-expected.txt:
      * http/tests/security/xssAuditor/iframe-javascript-url-twice-url-encode3-expected.txt:
      * http/tests/security/xssAuditor/iframe-javascript-url-url-encoded-expected.txt:
      * http/tests/security/xssAuditor/img-onerror-accented-char-expected.txt:
      * http/tests/security/xssAuditor/img-onerror-non-ASCII-char-default-encoding-expected.txt:
      * http/tests/security/xssAuditor/img-onerror-non-ASCII-char-expected.txt:
      * http/tests/security/xssAuditor/img-onerror-non-ASCII-char2-default-encoding-expected.txt:
      * http/tests/security/xssAuditor/img-onerror-non-ASCII-char2-expected.txt:
      * http/tests/security/xssAuditor/inline-event-HTML-entities-expected.txt:
      * http/tests/security/xssAuditor/javascript-link-HTML-entities-control-char-expected.txt:
      * http/tests/security/xssAuditor/javascript-link-HTML-entities-expected.txt:
      * http/tests/security/xssAuditor/javascript-link-HTML-entities-named-expected.txt:
      * http/tests/security/xssAuditor/javascript-link-HTML-entities-null-char-expected.txt:
      * http/tests/security/xssAuditor/javascript-link-ampersand-expected.txt:
      * http/tests/security/xssAuditor/javascript-link-control-char-expected.txt:
      * http/tests/security/xssAuditor/javascript-link-expected.txt:
      * http/tests/security/xssAuditor/javascript-link-null-char-expected.txt:
      * http/tests/security/xssAuditor/javascript-link-one-plus-one-expected.txt:
      * http/tests/security/xssAuditor/javascript-link-url-encoded-expected.txt:
      * http/tests/security/xssAuditor/link-onclick-ampersand-expected.txt:
      * http/tests/security/xssAuditor/link-onclick-control-char-expected.txt:
      * http/tests/security/xssAuditor/link-onclick-entities-expected.txt:
      * http/tests/security/xssAuditor/link-onclick-expected.txt:
      * http/tests/security/xssAuditor/link-onclick-null-char-expected.txt:
      * http/tests/security/xssAuditor/link-opens-new-window-expected.txt:
      * http/tests/security/xssAuditor/malformed-HTML-expected.txt:
      * http/tests/security/xssAuditor/malformed-xss-protection-header-expected.txt:
      * http/tests/security/xssAuditor/meta-tag-http-refresh-javascript-url-expected.txt:
      * http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-expected.txt:
      * http/tests/security/xssAuditor/object-embed-tag-control-char-expected.txt:
      * http/tests/security/xssAuditor/object-embed-tag-expected.txt:
      * http/tests/security/xssAuditor/object-embed-tag-null-char-expected.txt:
      * http/tests/security/xssAuditor/object-tag-expected.txt:
      * http/tests/security/xssAuditor/object-tag-javascript-url-expected.txt:
      * http/tests/security/xssAuditor/open-attribute-body-expected.txt:
      * http/tests/security/xssAuditor/open-event-handler-iframe-expected.txt:
      * http/tests/security/xssAuditor/post-from-iframe-expected.txt:
      * http/tests/security/xssAuditor/property-escape-comment-expected.txt:
      * http/tests/security/xssAuditor/property-escape-entity-expected.txt:
      * http/tests/security/xssAuditor/property-escape-expected.txt:
      * http/tests/security/xssAuditor/property-escape-long-expected.txt:
      * http/tests/security/xssAuditor/property-escape-quote-expected.txt:
      * http/tests/security/xssAuditor/script-tag-addslashes-backslash-expected.txt:
      * http/tests/security/xssAuditor/script-tag-addslashes-double-quote-expected.txt:
      * http/tests/security/xssAuditor/script-tag-addslashes-null-char-expected.txt:
      * http/tests/security/xssAuditor/script-tag-addslashes-single-quote-expected.txt:
      * http/tests/security/xssAuditor/script-tag-control-char-expected.txt:
      * http/tests/security/xssAuditor/script-tag-convoluted-expected.txt:
      * http/tests/security/xssAuditor/script-tag-entities-expected.txt:
      * http/tests/security/xssAuditor/script-tag-expected.txt:
      * http/tests/security/xssAuditor/script-tag-null-char-expected.txt:
      * http/tests/security/xssAuditor/script-tag-open-redirect-expected.txt:
      * http/tests/security/xssAuditor/script-tag-post-control-char-expected.txt:
      * http/tests/security/xssAuditor/script-tag-post-expected.txt:
      * http/tests/security/xssAuditor/script-tag-post-null-char-expected.txt:
      * http/tests/security/xssAuditor/script-tag-redirect-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-16bit-unicode-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-16bit-unicode-surrogate-pair-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-16bit-unicode2-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-16bit-unicode3-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-16bit-unicode4-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-16bit-unicode5-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-callbacks-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-fancy-unicode-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-invalid-closing-tag-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-invalid-url-encoding-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-source-control-char-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-source-data-url-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-source-double-quote-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-source-entities-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-source-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-source-no-quote-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-source-null-char-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-source-relative-scheme-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-source-same-host-with-query-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-source-unterminated-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-three-times-url-encoded-16bit-unicode-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-trailing-comment-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-trailing-comment2-expected.txt:
      * http/tests/security/xssAuditor/script-tag-with-trailing-comment3-expected.txt:
      * http/tests/security/xssAuditor/xss-filter-bypass-big5-expected.txt:
      * http/tests/security/xssAuditor/xss-filter-bypass-long-string-expected.txt:
      * http/tests/security/xssAuditor/xss-filter-bypass-sjis-expected.txt:
      * http/tests/security/xssAuditor/xss-protection-parsing-01-expected.txt:
      * http/tests/websocket/tests/hixie76/bad-handshake-crash-expected.txt:
      * http/tests/websocket/tests/hixie76/bad-sub-protocol-control-chars-expected.txt:
      * http/tests/websocket/tests/hixie76/bad-sub-protocol-empty-expected.txt:
      * http/tests/websocket/tests/hixie76/bad-sub-protocol-non-ascii-expected.txt:
      * http/tests/websocket/tests/hixie76/close-before-open-expected.txt:
      * http/tests/websocket/tests/hixie76/frame-length-overflow-expected.txt:
      * http/tests/websocket/tests/hixie76/handshake-error-expected.txt:
      * http/tests/websocket/tests/hixie76/handshake-fail-by-cross-origin-expected.txt:
      * http/tests/websocket/tests/hixie76/handshake-fail-by-maxlength-expected.txt:
      * http/tests/websocket/tests/hixie76/handshake-fail-by-no-connection-header-expected.txt:
      * http/tests/websocket/tests/hixie76/handshake-fail-by-no-cr-expected.txt:
      * http/tests/websocket/tests/hixie76/handshake-fail-by-no-upgrade-header-expected.txt:
      * http/tests/websocket/tests/hixie76/handshake-fail-by-prepended-null-expected.txt:
      * http/tests/websocket/tests/hixie76/handshake-fail-by-sub-protocol-mismatch-expected.txt:
      * http/tests/websocket/tests/hixie76/long-invalid-header-expected.txt:
      * http/tests/websocket/tests/hixie76/url-parsing-expected.txt:
      * http/tests/websocket/tests/hixie76/url-with-query-for-no-query-expected.txt:
      * http/tests/websocket/tests/hixie76/websocket-event-target-expected.txt:
      * http/tests/websocket/tests/hybi/bad-handshake-crash-expected.txt:
      * http/tests/websocket/tests/hybi/bad-sub-protocol-control-chars-expected.txt:
      * http/tests/websocket/tests/hybi/bad-sub-protocol-empty-expected.txt:
      * http/tests/websocket/tests/hybi/bad-sub-protocol-non-ascii-expected.txt:
      * http/tests/websocket/tests/hybi/broken-utf8-expected.txt:
      * http/tests/websocket/tests/hybi/close-before-open-expected.txt:
      * http/tests/websocket/tests/hybi/close-code-and-reason-expected.txt:
      * http/tests/websocket/tests/hybi/close-expected.txt:
      * http/tests/websocket/tests/hybi/fragmented-control-frame-expected.txt:
      * http/tests/websocket/tests/hybi/handshake-error-expected.txt:
      * http/tests/websocket/tests/hybi/handshake-fail-by-extensions-header-expected.txt:
      * http/tests/websocket/tests/hybi/handshake-fail-by-maxlength-expected.txt:
      * http/tests/websocket/tests/hybi/handshake-fail-by-no-accept-header-expected.txt:
      * http/tests/websocket/tests/hybi/handshake-fail-by-no-connection-header-expected.txt:
      * http/tests/websocket/tests/hybi/handshake-fail-by-no-cr-expected.txt:
      * http/tests/websocket/tests/hybi/handshake-fail-by-no-upgrade-header-expected.txt:
      * http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null-expected.txt:
      * http/tests/websocket/tests/hybi/handshake-fail-by-wrong-accept-header-expected.txt:
      * http/tests/websocket/tests/hybi/interleaved-fragments-expected.txt:
      * http/tests/websocket/tests/hybi/invalid-continuation-expected.txt:
      * http/tests/websocket/tests/hybi/invalid-subprotocol-characters-expected.txt:
      * http/tests/websocket/tests/hybi/invalid-subprotocols-expected.txt:
      * http/tests/websocket/tests/hybi/long-control-frame-expected.txt:
      * http/tests/websocket/tests/hybi/long-invalid-header-expected.txt:
      * http/tests/websocket/tests/hybi/reserved-bits-expected.txt:
      * http/tests/websocket/tests/hybi/reserved-opcodes-expected.txt:
      * http/tests/websocket/tests/hybi/send-file-blob-fail-expected.txt:
      * http/tests/websocket/tests/hybi/too-long-payload-expected.txt:
      * http/tests/websocket/tests/hybi/url-parsing-expected.txt:
      * http/tests/websocket/tests/hybi/websocket-event-target-expected.txt:
      * http/tests/websocket/tests/hybi/workers/close-code-and-reason-expected.txt:
      * http/tests/websocket/tests/hybi/workers/close-expected.txt:
      * http/tests/xmlhttprequest/access-control-basic-denied-expected.txt:
      * http/tests/xmlhttprequest/access-control-basic-denied-preflight-cache-expected.txt:
      * http/tests/xmlhttprequest/access-control-basic-get-fail-non-simple-expected.txt:
      * http/tests/xmlhttprequest/access-control-basic-non-simple-deny-cached-expected.txt:
      * http/tests/xmlhttprequest/access-control-basic-post-fail-non-simple-content-type-expected.txt:
      * http/tests/xmlhttprequest/access-control-basic-whitelist-response-headers-expected.txt:
      * http/tests/xmlhttprequest/access-control-preflight-async-header-denied-expected.txt:
      * http/tests/xmlhttprequest/access-control-preflight-async-method-denied-expected.txt:
      * http/tests/xmlhttprequest/access-control-preflight-async-not-supported-expected.txt:
      * http/tests/xmlhttprequest/access-control-preflight-sync-header-denied-expected.txt:
      * http/tests/xmlhttprequest/access-control-preflight-sync-method-denied-expected.txt:
      * http/tests/xmlhttprequest/access-control-preflight-sync-not-supported-expected.txt:
      * http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-expected.txt:
      * http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-without-wildcard-expected.txt:
      * http/tests/xmlhttprequest/cross-origin-no-authorization-expected.txt:
      * http/tests/xmlhttprequest/cross-origin-no-credential-prompt-expected.txt:
      * http/tests/xmlhttprequest/cross-site-denied-response-expected.txt:
      * http/tests/xmlhttprequest/cross-site-denied-response-sync-2-expected.txt:
      * http/tests/xmlhttprequest/cross-site-denied-response-sync-expected.txt:
      * http/tests/xmlhttprequest/get-dangerous-headers-expected.txt:
      * http/tests/xmlhttprequest/getResponseHeader-expected.txt:
      * http/tests/xmlhttprequest/onerror-event-expected.txt:
      * http/tests/xmlhttprequest/origin-whitelisting-https-expected.txt:
      * http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-subdomains-expected.txt:
      * http/tests/xmlhttprequest/origin-whitelisting-removal-expected.txt:
      * http/tests/xmlhttprequest/set-dangerous-headers-expected.txt:
      * http/tests/xmlhttprequest/simple-cross-origin-denied-events-expected.txt:
      * http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-expected.txt:
      * http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-sync-expected.txt:
      * http/tests/xmlhttprequest/simple-cross-origin-denied-events-sync-expected.txt:
      * http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt:
      * http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt:
      * http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt:
      * jquery/event-expected.txt:
      * media/csp-blocks-video-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-getAttribute-value-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-htmldom-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttribute-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNS-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNode-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNodeNS-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-getAttribute-value-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-htmldom-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttribute-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNS-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNode-expected.txt:
      * platform/chromium-linux/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNodeNS-expected.txt:
      * platform/chromium-linux/http/tests/security/xssAuditor/javascript-link-HTML-entities-null-char-expected.txt:
      * platform/chromium-linux/http/tests/websocket/tests/hixie76/bad-sub-protocol-control-chars-expected.txt:
      * platform/chromium-linux/http/tests/websocket/tests/hixie76/url-parsing-expected.txt:
      * platform/chromium-mac/fast/history/timed-refresh-in-cached-frame-expected.txt:
      * platform/chromium-mac/http/tests/security/cross-origin-xsl-BLOCKED-expected.txt:
      * platform/chromium-mac/http/tests/security/cross-origin-xsl-redirect-BLOCKED-expected.txt:
      * platform/chromium-mac/http/tests/websocket/tests/hixie76/bad-sub-protocol-control-chars-expected.txt:
      * platform/chromium-mac/http/tests/websocket/tests/hixie76/url-parsing-expected.txt:
      * platform/chromium-win/fast/history/timed-refresh-in-cached-frame-expected.txt:
      * platform/chromium-win/fast/xmlhttprequest/xmlhttprequest-no-file-access-expected.txt:
      * platform/chromium-win/http/tests/security/cross-origin-xsl-BLOCKED-expected.txt:
      * platform/chromium-win/http/tests/security/cross-origin-xsl-redirect-BLOCKED-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-getAttribute-value-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-htmldom-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttribute-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNS-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNode-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNodeNS-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-getAttribute-value-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-htmldom-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttribute-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNS-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNode-expected.txt:
      * platform/chromium-win/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNodeNS-expected.txt:
      * platform/chromium-win/http/tests/websocket/tests/hixie76/bad-sub-protocol-control-chars-expected.txt:
      * platform/chromium-win/http/tests/websocket/tests/hixie76/url-parsing-expected.txt:
      * platform/chromium-win/websocket/tests/bad-sub-protocol-control-chars-expected.txt:
      * platform/chromium-win/websocket/tests/bad-sub-protocol-expected.txt:
      * platform/chromium-win/websocket/tests/bad-sub-protocol-non-ascii-expected.txt:
      * platform/chromium-win/websocket/tests/url-parsing-expected.txt:
      * platform/chromium/fast/dom/Geolocation/notimer-after-unload-expected.txt:
      * platform/chromium/fast/events/onbeforeunload-focused-iframe-expected.txt:
      * platform/chromium/fast/events/onunload-clears-onbeforeunload-expected.txt:
      * platform/chromium/fast/events/onunload-expected.txt:
      * platform/chromium/fast/events/onunload-not-on-body-expected.txt:
      * platform/chromium/fast/events/onunload-window-property-expected.txt:
      * platform/chromium/fast/events/pageshow-pagehide-on-back-uncached-expected.txt:
      * platform/chromium/fast/history/timed-refresh-in-cached-frame-expected.txt:
      * platform/chromium/fast/loader/frames-with-unload-handlers-in-page-cache-expected.txt:
      * platform/chromium/fast/loader/page-dismissal-modal-dialogs-expected.txt:
      * platform/chromium/fast/loader/recursive-before-unload-crash-expected.txt:
      * platform/chromium/http/tests/inspector/console-xhr-logging-expected.txt:
      * platform/chromium/http/tests/security/aboutBlank/xss-DENIED-navigate-opener-document-write-expected.txt:
      * platform/chromium/http/tests/security/aboutBlank/xss-DENIED-navigate-opener-javascript-url-expected.txt:
      * platform/chromium/http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt:
      * platform/chromium/http/tests/security/contentSecurityPolicy/media-src-blocked-expected.txt:
      * platform/chromium/http/tests/security/cross-frame-access-call-expected.txt:
      * platform/chromium/http/tests/security/cross-frame-access-document-direct-expected.txt:
      * platform/chromium/http/tests/security/cross-frame-access-enumeration-expected.txt:
      * platform/chromium/http/tests/security/cross-frame-access-history-get-expected.txt:
      * platform/chromium/http/tests/security/cross-frame-access-history-put-expected.txt:
      * platform/chromium/http/tests/security/cross-frame-access-location-put-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-subframe-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-window-open-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-2-level-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-to-data-url-sub-frame-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-from-data-url-to-data-url-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-from-data-url-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-subframe-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-subframe-location-change-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-window-open-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-2-level-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-uppercase-expected.txt:
      * platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-window-open-expected.txt:
      * platform/chromium/http/tests/security/frameNavigation/xss-DENIED-plugin-navigation-expected.txt:
      * platform/chromium/http/tests/security/inactive-document-with-empty-security-origin-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-getAttribute-value-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-htmldom-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttribute-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNS-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNode-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNodeNS-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-getAttribute-value-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-htmldom-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttribute-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNS-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNode-expected.txt:
      * platform/chromium/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNodeNS-expected.txt:
      * platform/chromium/http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener-expected.txt:
      * platform/chromium/http/tests/security/listener/xss-JSTargetNode-onclick-shortcut-expected.txt:
      * platform/chromium/http/tests/security/listener/xss-XMLHttpRequest-addEventListener-expected.txt:
      * platform/chromium/http/tests/security/listener/xss-XMLHttpRequest-shortcut-expected.txt:
      * platform/chromium/http/tests/security/listener/xss-window-onclick-addEventListener-expected.txt:
      * platform/chromium/http/tests/security/listener/xss-window-onclick-shortcut-expected.txt:
      * platform/chromium/http/tests/security/mixedContent/insecure-iframe-in-main-frame-allowed-expected.txt:
      * platform/chromium/http/tests/security/mixedContent/insecure-iframe-in-main-frame-blocked-expected.txt:
      * platform/chromium/http/tests/security/mixedContent/insecure-image-in-main-frame-allowed-expected.txt:
      * platform/chromium/http/tests/security/mixedContent/insecure-image-in-main-frame-blocked-expected.txt:
      * platform/chromium/http/tests/security/mixedContent/insecure-script-in-main-frame-allowed-expected.txt:
      * platform/chromium/http/tests/security/mixedContent/insecure-script-in-main-frame-blocked-expected.txt:
      * platform/chromium/http/tests/security/redirect-BLOCKED-to-localURL-expected.txt:
      * platform/chromium/http/tests/security/window-named-proto-expected.txt:
      * platform/chromium/http/tests/security/xss-DENIED-assign-location-href-javascript-expected.txt:
      * platform/chromium/http/tests/security/xss-DENIED-frame-name-expected.txt:
      * platform/chromium/http/tests/websocket/tests/hybi/bad-sub-protocol-control-chars-expected.txt:
      * platform/chromium/http/tests/websocket/tests/hybi/url-parsing-expected.txt:
      * platform/chromium/media/csp-blocks-video-expected.txt:
      * platform/chromium/plugins/document-open-expected.txt:
      * platform/mac-leopard/http/tests/inspector/console-websocket-error-expected.txt:
      * platform/mac/http/tests/inspector/console-websocket-error-expected.txt:
      * platform/qt/http/tests/security/aboutBlank/xss-DENIED-navigate-opener-document-write-expected.txt:
      * platform/qt/http/tests/security/aboutBlank/xss-DENIED-navigate-opener-javascript-url-expected.txt:
      * platform/qt/http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt:
      * platform/qt/http/tests/websocket/tests/hixie76/bad-sub-protocol-non-ascii-expected.txt:
      * platform/qt/http/tests/websocket/tests/hybi/bad-sub-protocol-non-ascii-expected.txt:
      * plugins/document-open-expected.txt:
      * plugins/get-user-agent-with-null-npp-from-npp-new-expected.txt:
      * plugins/geturlnotify-during-document-teardown-expected.txt:
      * plugins/netscape-plugin-map-data-to-src-expected.txt:
      * plugins/netscape-plugin-setwindow-size-2-expected.txt:
      * plugins/netscape-plugin-setwindow-size-expected.txt:
      * plugins/no-mime-with-valid-extension-expected.txt:
      * plugins/open-and-close-window-with-plugin-expected.txt:
      * plugins/pass-different-npp-struct-expected.txt:
      * plugins/window-open-expected.txt:
      * storage/open-database-creation-callback-expected.txt:
      * storage/open-database-set-empty-version-expected.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0c3bdd92
  5. 09 Jan, 2012 3 commits
    • morrita@google.com's avatar
      [Refactoring] Moving between TreeScopes should be done by its own class. · e08d15ac
      morrita@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=75290
      
      Reviewed by Ryosuke Niwa.
      
      This change extracted Node::setTreeScopeRecursively(),
      setDocumentRecursively() and a part of setDocument() into a new
      class called TreeScopeAdopter. By doing this, the idea of
      moving a node from scope to scope, that was originally hidden
      behind the forest of Node APIs, has become clearer.
      
      Note that this change is a preparation for Bug 59816.
      
      No new tests. No behavioral change.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/ContainerNode.cpp: Followed the renaming.
      (WebCore::ContainerNode::takeAllChildrenFrom):
      (WebCore::ContainerNode::insertBefore):
      (WebCore::ContainerNode::replaceChild):
      (WebCore::ContainerNode::removeBetween):
      (WebCore::ContainerNode::removeChildren):
      (WebCore::ContainerNode::appendChild):
      (WebCore::ContainerNode::parserAddChild):
      * dom/DOMAllInOne.cpp:
      * dom/Document.cpp: Followed te renaming.
      (WebCore::Document::setDocType):
      (WebCore::Document::adoptNode):
      * dom/Element.cpp: Followed te renaming.
      (WebCore::Element::removeShadowRoot):
      * dom/Node.cpp:
      (WebCore::Node::setDocument):
      (WebCore::Node::setTreeScope):
      (WebCore::Node::didMoveToNewDocument):
      * dom/Node.h:
      * dom/TreeScope.h:
      * dom/TreeScope.cpp:
      (WebCore::TreeScope::adoptIfNeeded): moved from setTreeScopeRecursively()
      * dom/TreeScopeAdopter.cpp: Added.
      (WebCore::TreeScopeAdopter::TreeScopeAdopter):
      (WebCore::TreeScopeAdopter::moveTreeToNewScope):
      (WebCore::TreeScopeAdopter::moveTreeToNewDocument):
      (WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
      (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
      * dom/TreeScopeAdopter.h: Added.
      (WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
      (WebCore::TreeScopeAdopter::execute):
      (WebCore::TreeScopeAdopter::needsScopeChange()):
      (WebCore::TreeScopeAdopter::shadowRootFor):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e08d15ac
    • antti@apple.com's avatar
      possible regression: r104060 maybe causing crashes · 3f4f37b9
      antti@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=75676
      
      Reviewed by Andreas Kling.
      
      Based on the stacks, CSSStyleSelector may be getting deleted from under the
      CSSStyleSelector::appendAuthorStylesheets call. Protect by temporarily detaching
      from the document. Also add assertions to catch the case.
              
      No test, there is no known repro and the fix is speculative.
      
      * dom/Document.cpp:
      (WebCore::Document::Document):
      (WebCore::Document::setDocType):
      (WebCore::Document::childrenChanged):
      (WebCore::Document::clearStyleSelector):
      (WebCore::Document::updateActiveStylesheets):
      * dom/Document.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3f4f37b9
    • antti@apple.com's avatar
      Subtree invalidation on stylesheet change · a607df8b
      antti@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=75834
      
      Source/WebCore: 
      
      Reviewed by Andreas Kling.
              
      Currently if we add a stylesheet with scoped selectors and matching scope elements exist,
      we recalculate the entire document style. It is sufficient to invalidate the subtrees 
      matching the scope only.
              
      This allows us to do less full style recalcs on many popular web sites (nytimes.com for example).
      Subtree recalcs are typically much cheaper.
              
      Test: fast/css/id-or-class-before-stylesheet.html
      
      * dom/Document.cpp:
      (WebCore::Document::testAddedStylesheetRequiresStyleRecalc):
      (WebCore::Document::analyzeStylesheetChange):
      (WebCore::Document::updateActiveStylesheets):
      * dom/Document.h:
      
      LayoutTests: 
      
      Reviewed by Andreas Kling.
      
      * fast/css/id-or-class-before-stylesheet-expected.txt: Added.
      * fast/css/id-or-class-before-stylesheet.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a607df8b
  6. 08 Jan, 2012 1 commit
    • antti@apple.com's avatar
      Source/WebCore: REGRESSION (r104060): Layout Test... · 70726ab7
      antti@apple.com authored
      Source/WebCore: REGRESSION (r104060): Layout Test fast/media/viewport-media-query.html is occasionally failing
      https://bugs.webkit.org/show_bug.cgi?id=75633
      
      Reviewed by Andreas Kling.
              
      If something triggers CSSStyleSelector construction very early, before documentElement is known,
      it won't be able to resolve viewport-related media queries. In the included test case
      the attribute on <html> element triggers the style selector creation. I can't repro
      the fast/media/viewport-media-query.html failure but I suspect it is the same issue with
      a different mechanism for early CSSStyleSelector construction.
              
      - Reset style selector on documentElement change.
      - Remove the code for lazy documentElement initialization. It is not an useful optimization,
        the children of Document rarely change.
      
      Test: fast/media/viewport-media-query-synchronous.html
      
      * WebCore.exp.in:
      * dom/Document.cpp:
      (WebCore::Document::childrenChanged):
      * dom/Document.h:
      (WebCore::Document::documentElement):
      
      LayoutTests: Layout Test fast/media/viewport-media-query.html is occasionally failing
      https://bugs.webkit.org/show_bug.cgi?id=75633
      
      Reviewed by Andreas Kling.
      
      * fast/media/viewport-media-query-synchronous-expected.txt: Added.
      * fast/media/viewport-media-query-synchronous.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      70726ab7
  7. 07 Jan, 2012 1 commit
    • kling@webkit.org's avatar
      Simplify HTMLCollection ownership model. · fe420043
      kling@webkit.org authored
      <http://webkit.org/b/75437>
      
      Reviewed by Sam Weinig.
      
      Source/WebCore: 
      
      Remove HTMLCollection's inheritance from RefCounted and use OwnPtr to store it.
      Added ref()/deref() methods that forward to the collection's base node, these
      are only ever used by DOM wrappers.
      
      This is a behavior change, HTMLCollection wrappers now keep the base node alive.
      
      Test: fast/dom/htmlcollection-protects-base.html
      
      * html/HTMLCollection.h:
      (WebCore::HTMLCollection::ref):
      (WebCore::HTMLCollection::deref):
      
          Removed inheritance from RefCounted. Added ref/deref that forward the refs
          to the collection's base Node.
      
      * dom/Element.cpp:
      (WebCore::Element::~Element):
      * dom/Document.h:
      * dom/Document.cpp:
      (WebCore::Document::~Document):
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::~HTMLFormElement):
      * html/HTMLSelectElement.h:
      * html/HTMLSelectElement.cpp:
      
          Remove HTMLCollection::detachFromNode() and call sites.
      
      * html/HTMLAllCollection.cpp:
      (WebCore::HTMLAllCollection::namedItemWithIndex):
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::HTMLCollection):
      (WebCore::HTMLCollection::invalidateCacheIfNeeded):
      (WebCore::HTMLCollection::itemAfter):
      (WebCore::HTMLCollection::calcLength):
      (WebCore::HTMLCollection::length):
      (WebCore::HTMLCollection::item):
      (WebCore::HTMLCollection::nextItem):
      (WebCore::HTMLCollection::namedItem):
      (WebCore::HTMLCollection::updateNameCache):
      (WebCore::HTMLCollection::hasNamedItem):
      (WebCore::HTMLCollection::namedItems):
      (WebCore::HTMLCollection::tags):
      * html/HTMLFormCollection.cpp:
      (WebCore::HTMLFormCollection::calcLength):
      (WebCore::HTMLFormCollection::item):
      (WebCore::HTMLFormCollection::getNamedItem):
      (WebCore::HTMLFormCollection::namedItem):
      (WebCore::HTMLFormCollection::updateNameCache):
      * html/HTMLNameCollection.cpp:
      (WebCore::HTMLNameCollection::itemAfter):
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::add):
      (WebCore::HTMLOptionsCollection::remove):
      (WebCore::HTMLOptionsCollection::selectedIndex):
      (WebCore::HTMLOptionsCollection::setSelectedIndex):
      (WebCore::HTMLOptionsCollection::setLength):
      * html/HTMLPropertiesCollection.cpp:
      (WebCore::HTMLPropertiesCollection::length):
      (WebCore::HTMLPropertiesCollection::item):
      (WebCore::HTMLPropertiesCollection::names):
      
          Removed base node null-checks and assertions. Added one assertion to
          the HTMLCollection constructor (that m_base is non-null.)
      
      * dom/Document.h:
      * dom/Document.cpp:
      (WebCore::Document::openSearchDescriptionURL):
      (WebCore::Document::cachedCollection):
      (WebCore::Document::images):
      (WebCore::Document::applets):
      (WebCore::Document::embeds):
      (WebCore::Document::plugins):
      (WebCore::Document::objects):
      (WebCore::Document::scripts):
      (WebCore::Document::links):
      (WebCore::Document::forms):
      (WebCore::Document::anchors):
      (WebCore::Document::all):
      (WebCore::Document::windowNamedItems):
      (WebCore::Document::documentNamedItems):
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::namedItemGetter):
      * bindings/js/JSHTMLDocumentCustom.cpp:
      (WebCore::JSHTMLDocument::nameGetter):
      (WebCore::JSHTMLDocument::all):
      * bindings/v8/custom/V8DOMWindowCustom.cpp:
      (WebCore::V8DOMWindow::namedPropertyGetter):
      * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
      (WebCore::V8HTMLDocument::GetNamedProperty):
      * dom/ElementRareData.h:
      (WebCore::ElementRareData::ensureCachedHTMLCollection):
      * dom/NodeRareData.h:
      (WebCore::NodeRareData::properties):
      * html/HTMLAllCollection.h:
      * html/HTMLAllCollection.cpp:
      (WebCore::HTMLAllCollection::create):
      * html/HTMLCollection.h:
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::create):
      (WebCore::HTMLCollection::HTMLCollection):
      * html/HTMLDataListElement.cpp:
      (WebCore::HTMLDataListElement::options):
      * html/HTMLDataListElement.h:
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::children):
      * html/HTMLElement.h:
      * html/HTMLSelectElement.h:
      (WebCore::HTMLSelectElement::options):
      * html/HTMLFormCollection.h:
      * html/HTMLFormElement.h:
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::elements):
      * html/HTMLNameCollection.h:
      (WebCore::HTMLNameCollection::create):
      * html/HTMLFormCollection.cpp:
      (WebCore::HTMLFormCollection::create):
      * html/HTMLMapElement.cpp:
      (WebCore::HTMLMapElement::imageElement):
      (WebCore::HTMLMapElement::areas):
      * html/HTMLMapElement.h:
      * html/HTMLPropertiesCollection.h:
      * html/HTMLTableElement.cpp:
      (WebCore::HTMLTableElement::rows):
      (WebCore::HTMLTableElement::tBodies):
      * html/HTMLTableElement.h:
      * html/HTMLTableRowElement.cpp:
      (WebCore::HTMLTableRowElement::insertCell):
      (WebCore::HTMLTableRowElement::deleteCell):
      (WebCore::HTMLTableRowElement::cells):
      * html/HTMLTableRowElement.h:
      * html/HTMLTableRowsCollection.cpp:
      (WebCore::HTMLTableRowsCollection::create):
      (WebCore::HTMLTableRowsCollection::itemAfter):
      * html/HTMLTableRowsCollection.h:
      * html/HTMLTableSectionElement.h:
      * html/HTMLTableSectionElement.cpp:
      (WebCore::HTMLTableSectionElement::insertRow):
      (WebCore::HTMLTableSectionElement::deleteRow):
      (WebCore::HTMLTableSectionElement::rows):
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::selectedOption):
      * html/HTMLOptionsCollection.h:
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::create):
      * html/HTMLPropertiesCollection.cpp:
      (WebCore::HTMLPropertiesCollection::create):
      * Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::getDocumentLinks):
      
          Store cached HTMLCollections in OwnPtrs. Methods that used to return
          PassRefPtr<HTMLCollection> now simply return HTMLCollection*.
          Updated call sites as appropriate.
      
      LayoutTests: 
      
      - Removed fast/dom/htmlcollection-zombies.html since it was testing bogus behavior.
      - Added a test to verify that HTMLCollection protects its base node from GC.
      
      * fast/dom/htmlcollection-protects-base-expected.txt: Added.
      * fast/dom/htmlcollection-protects-base.html: Added.
      * fast/dom/htmlcollection-zombies-expected.txt: Removed.
      * fast/dom/htmlcollection-zombies.html: Removed.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fe420043
  8. 06 Jan, 2012 5 commits
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r104373 and r104374. · fac10325
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/104373
      http://trac.webkit.org/changeset/104374
      https://bugs.webkit.org/show_bug.cgi?id=75769
      
      Too many assertion failures. (Requested by kling on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-01-06
      
      Source/WebCore:
      
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::namedItemGetter):
      * bindings/js/JSHTMLDocumentCustom.cpp:
      (WebCore::JSHTMLDocument::nameGetter):
      (WebCore::JSHTMLDocument::all):
      * bindings/v8/custom/V8DOMWindowCustom.cpp:
      (WebCore::V8DOMWindow::namedPropertyGetter):
      * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
      (WebCore::V8HTMLDocument::GetNamedProperty):
      * dom/Document.cpp:
      (WebCore::Document::~Document):
      (WebCore::Document::openSearchDescriptionURL):
      (WebCore::Document::cachedCollection):
      (WebCore::Document::images):
      (WebCore::Document::applets):
      (WebCore::Document::embeds):
      (WebCore::Document::plugins):
      (WebCore::Document::objects):
      (WebCore::Document::scripts):
      (WebCore::Document::links):
      (WebCore::Document::forms):
      (WebCore::Document::anchors):
      (WebCore::Document::all):
      (WebCore::Document::windowNamedItems):
      (WebCore::Document::documentNamedItems):
      * dom/Document.h:
      * dom/Element.cpp:
      (WebCore::Element::~Element):
      * dom/ElementRareData.h:
      (WebCore::ElementRareData::cachedHTMLCollection):
      (WebCore::ElementRareData::ensureCachedHTMLCollection):
      * dom/NodeRareData.h:
      (WebCore::NodeRareData::properties):
      * html/HTMLAllCollection.cpp:
      (WebCore::HTMLAllCollection::create):
      (WebCore::HTMLAllCollection::namedItemWithIndex):
      * html/HTMLAllCollection.h:
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::HTMLCollection):
      (WebCore::HTMLCollection::create):
      (WebCore::HTMLCollection::detachFromNode):
      (WebCore::HTMLCollection::invalidateCacheIfNeeded):
      (WebCore::HTMLCollection::itemAfter):
      (WebCore::HTMLCollection::calcLength):
      (WebCore::HTMLCollection::length):
      (WebCore::HTMLCollection::item):
      (WebCore::HTMLCollection::nextItem):
      (WebCore::HTMLCollection::namedItem):
      (WebCore::HTMLCollection::updateNameCache):
      (WebCore::HTMLCollection::hasNamedItem):
      (WebCore::HTMLCollection::namedItems):
      (WebCore::HTMLCollection::tags):
      * html/HTMLCollection.h:
      * html/HTMLDataListElement.cpp:
      (WebCore::HTMLDataListElement::options):
      * html/HTMLDataListElement.h:
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::children):
      * html/HTMLElement.h:
      * html/HTMLFormCollection.cpp:
      (WebCore::HTMLFormCollection::create):
      (WebCore::HTMLFormCollection::calcLength):
      (WebCore::HTMLFormCollection::item):
      (WebCore::HTMLFormCollection::getNamedItem):
      (WebCore::HTMLFormCollection::namedItem):
      (WebCore::HTMLFormCollection::updateNameCache):
      * html/HTMLFormCollection.h:
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::~HTMLFormElement):
      (WebCore::HTMLFormElement::elements):
      * html/HTMLFormElement.h:
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::selectedOption):
      * html/HTMLMapElement.cpp:
      (WebCore::HTMLMapElement::imageElement):
      (WebCore::HTMLMapElement::areas):
      * html/HTMLMapElement.h:
      * html/HTMLNameCollection.cpp:
      (WebCore::HTMLNameCollection::itemAfter):
      * html/HTMLNameCollection.h:
      (WebCore::HTMLNameCollection::create):
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::create):
      (WebCore::HTMLOptionsCollection::add):
      (WebCore::HTMLOptionsCollection::remove):
      (WebCore::HTMLOptionsCollection::selectedIndex):
      (WebCore::HTMLOptionsCollection::setSelectedIndex):
      (WebCore::HTMLOptionsCollection::setLength):
      * html/HTMLOptionsCollection.h:
      * html/HTMLPropertiesCollection.cpp:
      (WebCore::HTMLPropertiesCollection::create):
      (WebCore::HTMLPropertiesCollection::length):
      (WebCore::HTMLPropertiesCollection::item):
      (WebCore::HTMLPropertiesCollection::names):
      * html/HTMLPropertiesCollection.h:
      * html/HTMLSelectElement.cpp:
      (WebCore::HTMLSelectElement::~HTMLSelectElement):
      (WebCore::HTMLSelectElement::options):
      * html/HTMLSelectElement.h:
      * html/HTMLTableElement.cpp:
      (WebCore::HTMLTableElement::~HTMLTableElement):
      
      LayoutTests:
      
      * fast/dom/htmlcollection-protects-base-expected.txt: Removed.
      * fast/dom/htmlcollection-protects-base.html: Removed.
      * fast/dom/htmlcollection-zombies-expected.txt: Added.
      * fast/dom/htmlcollection-zombies.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fac10325
    • kling@webkit.org's avatar
      Simplify HTMLCollection ownership model. · 23ad56ac
      kling@webkit.org authored
      <http://webkit.org/b/75437>
      
      Reviewed by Sam Weinig.
      
      Source/WebCore: 
      
      Remove HTMLCollection's inheritance from RefCounted and use OwnPtr to store it.
      Added ref()/deref() methods that forward to the collection's base node, these
      are only ever used by DOM wrappers.
      
      This is a behavior change, HTMLCollection wrappers now keep the base node alive.
      
      Test: fast/dom/htmlcollection-protects-base.html
      
      * html/HTMLCollection.h:
      (WebCore::HTMLCollection::ref):
      (WebCore::HTMLCollection::deref):
      
          Removed inheritance from RefCounted. Added ref/deref that forward the refs
          to the collection's base Node.
      
      * dom/Element.cpp:
      (WebCore::Element::~Element):
      * dom/Document.h:
      * dom/Document.cpp:
      (WebCore::Document::~Document):
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::~HTMLFormElement):
      * html/HTMLSelectElement.h:
      * html/HTMLSelectElement.cpp:
      
          Remove HTMLCollection::detachFromNode() and call sites.
      
      * html/HTMLAllCollection.cpp:
      (WebCore::HTMLAllCollection::namedItemWithIndex):
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::HTMLCollection):
      (WebCore::HTMLCollection::invalidateCacheIfNeeded):
      (WebCore::HTMLCollection::itemAfter):
      (WebCore::HTMLCollection::calcLength):
      (WebCore::HTMLCollection::length):
      (WebCore::HTMLCollection::item):
      (WebCore::HTMLCollection::nextItem):
      (WebCore::HTMLCollection::namedItem):
      (WebCore::HTMLCollection::updateNameCache):
      (WebCore::HTMLCollection::hasNamedItem):
      (WebCore::HTMLCollection::namedItems):
      (WebCore::HTMLCollection::tags):
      * html/HTMLFormCollection.cpp:
      (WebCore::HTMLFormCollection::calcLength):
      (WebCore::HTMLFormCollection::item):
      (WebCore::HTMLFormCollection::getNamedItem):
      (WebCore::HTMLFormCollection::namedItem):
      (WebCore::HTMLFormCollection::updateNameCache):
      * html/HTMLNameCollection.cpp:
      (WebCore::HTMLNameCollection::itemAfter):
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::add):
      (WebCore::HTMLOptionsCollection::remove):
      (WebCore::HTMLOptionsCollection::selectedIndex):
      (WebCore::HTMLOptionsCollection::setSelectedIndex):
      (WebCore::HTMLOptionsCollection::setLength):
      * html/HTMLPropertiesCollection.cpp:
      (WebCore::HTMLPropertiesCollection::length):
      (WebCore::HTMLPropertiesCollection::item):
      (WebCore::HTMLPropertiesCollection::names):
      
          Removed base node null-checks and assertions. Added one assertion to
          the HTMLCollection constructor (that m_base is non-null.)
      
      * dom/Document.h:
      * dom/Document.cpp:
      (WebCore::Document::openSearchDescriptionURL):
      (WebCore::Document::cachedCollection):
      (WebCore::Document::images):
      (WebCore::Document::applets):
      (WebCore::Document::embeds):
      (WebCore::Document::plugins):
      (WebCore::Document::objects):
      (WebCore::Document::scripts):
      (WebCore::Document::links):
      (WebCore::Document::forms):
      (WebCore::Document::anchors):
      (WebCore::Document::all):
      (WebCore::Document::windowNamedItems):
      (WebCore::Document::documentNamedItems):
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::namedItemGetter):
      * bindings/js/JSHTMLDocumentCustom.cpp:
      (WebCore::JSHTMLDocument::nameGetter):
      (WebCore::JSHTMLDocument::all):
      * bindings/v8/custom/V8DOMWindowCustom.cpp:
      (WebCore::V8DOMWindow::namedPropertyGetter):
      * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
      (WebCore::V8HTMLDocument::GetNamedProperty):
      * dom/ElementRareData.h:
      (WebCore::ElementRareData::ensureCachedHTMLCollection):
      * dom/NodeRareData.h:
      (WebCore::NodeRareData::properties):
      * html/HTMLAllCollection.h:
      * html/HTMLAllCollection.cpp:
      (WebCore::HTMLAllCollection::create):
      * html/HTMLCollection.h:
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::create):
      (WebCore::HTMLCollection::HTMLCollection):
      * html/HTMLDataListElement.cpp:
      (WebCore::HTMLDataListElement::options):
      * html/HTMLDataListElement.h:
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::children):
      * html/HTMLElement.h:
      * html/HTMLSelectElement.h:
      (WebCore::HTMLSelectElement::options):
      * html/HTMLFormCollection.h:
      * html/HTMLFormElement.h:
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::elements):
      * html/HTMLNameCollection.h:
      (WebCore::HTMLNameCollection::create):
      * html/HTMLFormCollection.cpp:
      (WebCore::HTMLFormCollection::create):
      * html/HTMLMapElement.cpp:
      (WebCore::HTMLMapElement::imageElement):
      (WebCore::HTMLMapElement::areas):
      * html/HTMLMapElement.h:
      * html/HTMLPropertiesCollection.h:
      * html/HTMLTableElement.cpp:
      (WebCore::HTMLTableElement::rows):
      (WebCore::HTMLTableElement::tBodies):
      * html/HTMLTableElement.h:
      * html/HTMLTableRowElement.cpp:
      (WebCore::HTMLTableRowElement::insertCell):
      (WebCore::HTMLTableRowElement::deleteCell):
      (WebCore::HTMLTableRowElement::cells):
      * html/HTMLTableRowElement.h:
      * html/HTMLTableRowsCollection.cpp:
      (WebCore::HTMLTableRowsCollection::create):
      (WebCore::HTMLTableRowsCollection::itemAfter):
      * html/HTMLTableRowsCollection.h:
      * html/HTMLTableSectionElement.h:
      * html/HTMLTableSectionElement.cpp:
      (WebCore::HTMLTableSectionElement::insertRow):
      (WebCore::HTMLTableSectionElement::deleteRow):
      (WebCore::HTMLTableSectionElement::rows):
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::selectedOption):
      * html/HTMLOptionsCollection.h:
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::create):
      * html/HTMLPropertiesCollection.cpp:
      (WebCore::HTMLPropertiesCollection::create):
      
          Store cached HTMLCollections in OwnPtrs. Methods that used to return
          PassRefPtr<HTMLCollection> now simply return HTMLCollection*.
          Updated call sites as appropriate.
      
      LayoutTests: 
      
      - Removed fast/dom/htmlcollection-zombies.html since it was testing bogus behavior.
      - Added a test to verify that HTMLCollection protects its base node from GC.
      
      * fast/dom/htmlcollection-protects-base-expected.txt: Added.
      * fast/dom/htmlcollection-protects-base.html: Added.
      * fast/dom/htmlcollection-zombies-expected.txt: Removed.
      * fast/dom/htmlcollection-zombies.html: Removed.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      23ad56ac
    • antti@apple.com's avatar
      REGRESSION (r104060): fast/forms/textarea-metrics.html is failing · 0a03deb8
      antti@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=75644
      
      Reviewed by Alexey Proskuryakov.
      
      We need to clear the style selector on doc type change as the doc type
      may affect interpretation of the stylesheets. r104060 extended the life
      of the style selector in some cases, exposing this problem.
      
      * dom/Document.cpp:
      (WebCore::Document::setDocType):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0a03deb8
    • tkent@chromium.org's avatar
      Fix a crash by importing an element of which local name ends with ":input". · 02045fa1
      tkent@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=75103
      
      Reviewed by Ryosuke Niwa.
      
      Source/WebCore:
      
      Test: fast/dom/importNode-confusing-localName.html
      
      * dom/Document.cpp:
      (WebCore::Document::importNode): Pass QualifiedName of the source elemnt
      to createElement() in order to avoid unnecessary serialization and
      parsing of the qualified name
      
      LayoutTests:
      
      * fast/dom/importNode-confusing-localName-expected.txt: Added.
      * fast/dom/importNode-confusing-localName.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      02045fa1
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r104259 and r104261. · 0aefadd5
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/104259
      http://trac.webkit.org/changeset/104261
      https://bugs.webkit.org/show_bug.cgi?id=75688
      
      Caused assertion failures (Requested by rniwa on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-01-06
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::takeAllChildrenFrom):
      (WebCore::ContainerNode::insertBefore):
      (WebCore::ContainerNode::replaceChild):
      (WebCore::ContainerNode::removeBetween):
      (WebCore::ContainerNode::removeChildren):
      (WebCore::ContainerNode::appendChild):
      (WebCore::ContainerNode::parserAddChild):
      * dom/DOMAllInOne.cpp:
      * dom/Document.cpp:
      (WebCore::Document::setDocType):
      (WebCore::Document::adoptNode):
      * dom/Element.cpp:
      (WebCore::Element::removeShadowRoot):
      * dom/Node.cpp:
      (WebCore::Node::setDocument):
      (WebCore::Node::setTreeScopeRecursively):
      (WebCore::Node::setDocumentRecursively):
      (WebCore::Node::didMoveToNewDocument):
      * dom/Node.h:
      * dom/TreeScope.cpp:
      * dom/TreeScope.h:
      * dom/TreeScopeAdopter.cpp: Removed.
      * dom/TreeScopeAdopter.h: Removed.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0aefadd5
  9. 05 Jan, 2012 1 commit
    • morrita@google.com's avatar
      [Refactoring] Moving between TreeScopes should be done by its own class. · 6f422e73
      morrita@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=75290
      
      Reviewed by Ryosuke Niwa.
      
      This change extracted Node::setTreeScopeRecursively(),
      setDocumentRecursively() and a part of setDocument() into a new
      class called TreeScopeAdopter. By doing this, the idea of
      moving a node from scope to scope, that was originally hidden
      behind the forest of Node APIs, has become clearer.
      
      Note that this change is a preparation for Bug 59816.
      
      No new tests. No behavioral change.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/ContainerNode.cpp: Followed the renaming.
      (WebCore::ContainerNode::takeAllChildrenFrom):
      (WebCore::ContainerNode::insertBefore):
      (WebCore::ContainerNode::replaceChild):
      (WebCore::ContainerNode::removeBetween):
      (WebCore::ContainerNode::removeChildren):
      (WebCore::ContainerNode::appendChild):
      (WebCore::ContainerNode::parserAddChild):
      * dom/DOMAllInOne.cpp:
      * dom/Document.cpp: Followed te renaming.
      (WebCore::Document::setDocType):
      (WebCore::Document::adoptNode):
      * dom/Element.cpp: Followed te renaming.
      (WebCore::Element::removeShadowRoot):
      * dom/Node.cpp:
      (WebCore::Node::setDocument):
      (WebCore::Node::setTreeScope):
      (WebCore::Node::didMoveToNewDocument):
      * dom/Node.h:
      * dom/TreeScope.h:
      * dom/TreeScope.cpp:
      (WebCore::TreeScope::adoptIfNeeded): moved from setTreeScopeRecursively()
      * dom/TreeScopeAdopter.cpp: Added.
      (WebCore::TreeScopeAdopter::TreeScopeAdopter):
      (WebCore::TreeScopeAdopter::moveTreeToNewScope):
      (WebCore::TreeScopeAdopter::moveTreeToNewDocument):
      (WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
      (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
      * dom/TreeScopeAdopter.h: Added.
      (WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
      (WebCore::TreeScopeAdopter::execute):
      (WebCore::TreeScopeAdopter::needsScopeChange()):
      (WebCore::TreeScopeAdopter::shadowRootFor):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6f422e73
  10. 04 Jan, 2012 1 commit
    • antti@apple.com's avatar
      Analyze stylesheet scope to minimize style recalcs · 8f4b2d66
      antti@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=75508
              
      Reviewed by Dave Hyatt.
      
      It is a relatively common pattern to use inline stylesheets in document body where all rules are scoped using descendant selector
      
      <style>
      #foo {...}
      #foo div {...}
      #foo .bar {...}
      </style>
      
      When this pattern is used it is also common that the rules only apply to elements that come after the style element. 
      
      When the set of active stylesheets changes we invalidate and recompute the entire document style. This is very expensive. We can 
      detect the case above and avoid the style recalc.
              
      On engadget.com, this patch cuts the time spent in style recalcs to roughly half. There are further savings from reduced 
      relayouts. In total the engine CPU time used over the page load is reduced by ~10%.
      
      * css/CSSStyleSelector.cpp:
      (WebCore::CSSStyleSelector::CSSStyleSelector):
      (WebCore::CSSStyleSelector::collectFeatures):
              
          Refactor feature collection from constructor to a separate function.
              
      (WebCore::CSSStyleSelector::appendAuthorStylesheets):
              
          New function for non-destructively updating the style selector.
              
      (WebCore::CSSStyleSelector::Features::clear):
              
          Clear the features for another collection.
                  
      (WebCore::CSSStyleSelector::determineStylesheetSelectorScopes):
              
          Find if all rules on a stylesheetare scoped to some set of ids and classes.
              
      (WebCore::CSSStyleSelector::styleForDocument):
              
          Add optional font selector argument. We updated the correct base style font on style selector construction but that is no longer sufficient
          as font selector may be updated without reconstructing the style selector.
              
      (WebCore::RuleSet::addRulesFromSheet):
              
          Invalidate the matched declaration cache in case of new font-face rules.
              
      * css/CSSStyleSelector.h:
      * css/SelectorChecker.cpp:
      (WebCore::SelectorChecker::determineSelectorScopes):
              
          Find if all rules on a selector list are scoped to some set of ids and classes.
              
      * css/SelectorChecker.h:
      * dom/Document.cpp:
      (WebCore::Document::Document):
      (WebCore::Document::recalcStyle):
              
          Pass the font selector, if exists, to styleForDocument so we always have the base font up to date.
              
      (WebCore::Document::combineCSSFeatureFlags):
      (WebCore::Document::resetCSSFeatureFlags):
      (WebCore::Document::createStyleSelector):
      
          Refactor css feature flag resetting to functions.
              
      (WebCore::Document::removePendingSheet):
              
          Use new PendingStylesheetCompleted flag when new stylesheets arrive.
      
      (WebCore::Document::styleSelectorChanged):
      
          Skip style recalc if it is not needed.
      
      (WebCore::Document::collectActiveStylesheets):
              
          Refactor collecting stylesheets to a separate function.
              
      (WebCore::Document::testAddedStylesheetRequiresStyleRecalc):
              
          Determine the scopes and use hasElementWithId/getElementsByClassName to figure out if any scoped elements currently exist in the tree.
              
      (WebCore::Document::analyzeStylesheetChange):
              
          Figure out if we can update the style selector incrementally and if we can skip the style recalc.
              
      (WebCore::Document::updateActiveStylesheets):
              
          Renamed from recalcStyleSelector.
          Invoke the new analysis functions.
              
      * dom/Document.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8f4b2d66
  11. 01 Jan, 2012 1 commit
    • kling@webkit.org's avatar
      Move the remaining collections to caching on their respective base nodes. · a3a65e36
      kling@webkit.org authored
      <http://webkit.org/b/75416>
      
      Reviewed by Anders Carlsson.
      
      Source/WebCore: 
      
      Add a (lazily-allocated) array of HTMLCollections to ElementRareData and cache
      the various collections on their base node rather than recreating them every time.
      
      Test: fast/dom/collection-idempotence.html
            fast/dom/gc-9.html
      
      * html/CollectionType.h:
      * dom/ElementRareData.h:
      (WebCore::ElementRareData::hasCachedHTMLCollections):
      (WebCore::ElementRareData::cachedHTMLCollection):
      (WebCore::ElementRareData::ensureCachedHTMLCollection):
      * dom/Element.h:
      * dom/Element.cpp:
      (WebCore::Element::ensureCachedHTMLCollection):
      
          Plumbing to cache HTMLCollections on ElementRareData.
      
      (WebCore::Element::~Element):
      
          Detach any cached collections from an element when it's destroyed.
      
      * html/HTMLCollection.h:
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::HTMLCollection):
      (WebCore::HTMLCollection::create):
      (WebCore::HTMLCollection::~HTMLCollection):
      (WebCore::HTMLCollection::detachFromNode):
      * html/HTMLTableRowsCollection.cpp:
      (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
      * html/HTMLFormCollection.cpp:
      (WebCore::HTMLFormCollection::HTMLFormCollection):
      * dom/Document.cpp:
      (WebCore::Document::cachedCollection):
      
          Consolidate the HTMLCollection constructors and get rid of the hacks to
          optionally retain the base node.
      
      * html/HTMLDataListElement.cpp:
      (WebCore::HTMLDataListElement::options):
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::children):
      * html/HTMLMapElement.cpp:
      (WebCore::HTMLMapElement::areas):
      * html/HTMLTableElement.cpp:
      (WebCore::HTMLTableElement::tBodies):
      * html/HTMLTableRowElement.cpp:
      (WebCore::HTMLTableRowElement::cells):
      * html/HTMLTableSectionElement.cpp:
      (WebCore::HTMLTableSectionElement::rows):
      
          Cached collections!
      
      LayoutTests: 
      
      - Updated gc-9.html to document the new lifetime behavior of HTMLCollections.
      - Merged all the *collection-idempotence.html tests into a big one and added
        tests for the newly changed collections.
      
      * fast/dom/gc-9-expected.txt:
      * fast/dom/gc-9.html:
      * fast/dom/collection-idempotence-expected.txt: Added.
      * fast/dom/collection-idempotence.html: Added.
      * fast/dom/document-collection-idempotence-expected.txt: Removed.
      * fast/dom/document-collection-idempotence.html: Removed.
      * fast/dom/form-elements-collection-idempotence-expected.txt: Removed.
      * fast/dom/form-elements-collection-idempotence.html: Removed.
      * fast/dom/select-options-collection-idempotence-expected.txt: Removed.
      * fast/dom/select-options-collection-idempotence.html: Removed.
      * fast/dom/table-rows-collection-idempotence-expected.txt: Removed.
      * fast/dom/table-rows-collection-idempotence.html: Removed.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a3a65e36
  12. 31 Dec, 2011 3 commits
    • kling@webkit.org's avatar
      Make HTMLCollections play nice after their base node is gone. · f16278aa
      kling@webkit.org authored
      <http://webkit.org/b/75410>
      
      Reviewed by Anders Carlsson.
      
      Source/WebCore: 
      
      Added HTMLCollection::detachFromNode() and call that from destructors of nodes
      with cached collections.
      
      Sprinkled checks/assertions where applicable to make sure HTMLCollections are
      empty after their associated node has been destroyed.
      
      This is a slight change in behavior, as collections would previously keep
      their nodes alive indefinitely. Added a test to document this.
      
      Test: fast/dom/htmlcollection-zombies.html
      
      * dom/Document.cpp:
      (WebCore::Document::~Document):
      * html/HTMLAllCollection.cpp:
      (WebCore::HTMLAllCollection::namedItemWithIndex):
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::detachFromNode):
      (WebCore::HTMLCollection::resetCollectionInfo):
      (WebCore::HTMLCollection::itemAfter):
      (WebCore::HTMLCollection::calcLength):
      (WebCore::HTMLCollection::length):
      (WebCore::HTMLCollection::item):
      (WebCore::HTMLCollection::nextItem):
      (WebCore::HTMLCollection::namedItem):
      (WebCore::HTMLCollection::updateNameCache):
      (WebCore::HTMLCollection::hasNamedItem):
      (WebCore::HTMLCollection::namedItems):
      (WebCore::HTMLCollection::tags):
      * html/HTMLCollection.h:
      * html/HTMLFormCollection.cpp:
      (WebCore::HTMLFormCollection::calcLength):
      (WebCore::HTMLFormCollection::item):
      (WebCore::HTMLFormCollection::getNamedItem):
      (WebCore::HTMLFormCollection::getNamedFormItem):
      (WebCore::HTMLFormCollection::namedItem):
      (WebCore::HTMLFormCollection::updateNameCache):
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::~HTMLFormElement):
      * html/HTMLNameCollection.cpp:
      (WebCore::HTMLNameCollection::itemAfter):
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::add):
      (WebCore::HTMLOptionsCollection::remove):
      (WebCore::HTMLOptionsCollection::selectedIndex):
      (WebCore::HTMLOptionsCollection::setSelectedIndex):
      (WebCore::HTMLOptionsCollection::setLength):
      * html/HTMLPropertiesCollection.cpp:
      (WebCore::HTMLPropertiesCollection::length):
      (WebCore::HTMLPropertiesCollection::item):
      (WebCore::HTMLPropertiesCollection::names):
      * html/HTMLSelectElement.cpp:
      (WebCore::HTMLSelectElement::~HTMLSelectElement):
      * html/HTMLSelectElement.h:
      * html/HTMLTableElement.cpp:
      (WebCore::HTMLTableElement::~HTMLTableElement):
      * html/HTMLTableElement.h:
      * html/HTMLTableRowsCollection.cpp:
      (WebCore::HTMLTableRowsCollection::itemAfter):
      
      LayoutTests: 
      
      * fast/dom/htmlcollection-zombies-expected.txt: Added.
      * fast/dom/htmlcollection-zombies.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f16278aa
    • kling@webkit.org's avatar
      Cache named item collections on Document, not just their caches. · 04a91562
      kling@webkit.org authored
      <http://webkit.org/b/75403>
      
      Reviewed by Anders Carlsson.
      
      Keep two maps of name -> RefPtr<HTMLNameCollection> on Document. We already
      had maps for the CollectionCaches and were creating the HTMLNameCollections
      every time they were accessed. We now let the collections create and manage
      the CollectionCaches instead of Document.
      
      No new tests since these collections are not exposed to the web.
      
      * dom/Document.h:
      * dom/Document.cpp:
      (WebCore::Document::windowNamedItems):
      (WebCore::Document::documentNamedItems):
      
          Replace the name/CollectionCache maps by name/HTMLNameCollection maps.
      
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::namedItemGetter):
      * bindings/js/JSHTMLDocumentCustom.cpp:
      (WebCore::JSHTMLDocument::nameGetter):
      
          Pass names as AtomicStrings to Document's collection getters.
      
      * html/HTMLNameCollection.h:
      (WebCore::HTMLNameCollection::create):
      * html/HTMLNameCollection.cpp:
      (WebCore::HTMLNameCollection::HTMLNameCollection):
      
          Store the name in an AtomicString instead of a String, incidentally
          making traversal of HTMLNameCollections more efficient.
      
      * html/CollectionType.h:
      
          Remove two now-unneeded constants.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      04a91562
    • kling@webkit.org's avatar
      Remove Document::collectionInfo() and let collections manage their caches. · b906afa6
      kling@webkit.org authored
      <http://webkit.org/b/75401>
      
      Reviewed by Anders Carlsson.
      
      Remove the CollectionCaches from Document and have the document's collections
      create and manage the caches on-demand instead. This is a step towards merging
      CollectionCache into HTMLCollection.
      
      * dom/Document.h:
      * dom/Document.cpp:
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::HTMLCollection):
      * html/HTMLOptionsCollection.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b906afa6
  13. 29 Dec, 2011 2 commits
  14. 28 Dec, 2011 1 commit
  15. 25 Dec, 2011 1 commit
  16. 21 Dec, 2011 2 commits
    • tkent@chromium.org's avatar
      Change the item type of Document::m_formElementsWithState from Element* · c0292096
      tkent@chromium.org authored
      to HTMLFormControlElementWithState*.
      https://bugs.webkit.org/show_bug.cgi?id=74998
      
      Reviewed by Andreas Kling.
      
      No new tests. Just refactoring.
      
      * dom/Document.cpp:
      (WebCore::Document::formElementsState): Use HTMLFormControlElementWithState*.
      * dom/Document.h:
      (WebCore::Document::registerFormElementWithState): Change the argument type.
      (WebCore::Document::unregisterFormElementWithState): ditto.
      (WebCore::Document::formElements): Renamed from getFormElements().
      * dom/Element.h:
      Removed shouldSaveAndRestoreFormControlState(), saveFormControlState(),
      and restoreFormControlState() because they are not called for Element
      anymore.
      * html/HTMLFormControlElement.h:
      - Make formControlName() and formControlType() public.
       They are called from Document class.
      - Make shouldSaveAndRestoreFormControlState() public, and non-virtual.
       This is called from Document class, and no other classes override this.
      (WebCore::HTMLFormControlElementWithState::saveFormControlState):
      Moved from Element.
      (WebCore::HTMLFormControlElementWithState::restoreFormControlState): ditto.
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::updateCheckedRadioButtons):
      Use HTMLFormControlElementWithState* instead of Element*.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103491 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c0292096
    • reni@webkit.org's avatar
      Fulfill FIXME in HTMLLinkElement.h. · 518b3c9a
      reni@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=74278
      
      Rename isStyleSheetLoading() method to styleSheetIsLoading().
      This new one has the correct grammar.
      
      Reviewed by Darin Adler.
      
      No new tests because the functionality remains the same.
      
      * dom/Document.cpp:
      (WebCore::Document::recalcStyleSelector):
      * html/HTMLLinkElement.cpp:
      (WebCore::HTMLLinkElement::setDisabledState):
      (WebCore::HTMLLinkElement::styleSheetIsLoading):
      (WebCore::HTMLLinkElement::sheetLoaded):
      * html/HTMLLinkElement.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      518b3c9a
  17. 19 Dec, 2011 2 commits
    • adamk@chromium.org's avatar
      Remove unused ExceptionCode& argument from Element::setAttribute(QualifiedName) · 3e1e12b9
      adamk@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=74740
      
      Reviewed by Ryosuke Niwa.
      
      Updated lots of callers to remove third argument. The list of changes
      below only lists things other than updating callers.
      
      * dom/Document.cpp:
      (WebCore::Document::importNode):
      * dom/Element.cpp:
      (WebCore::Element::setAttribute):
      (WebCore::Element::setAttributeNS):
      (WebCore::Element::setIntegralAttribute):
      (WebCore::Element::setUnsignedIntegralAttribute):
      * dom/Element.h: Removed third arg from method, removed old two-arg
      overload which now has an identical signature.
      * editing/mac/EditorMac.mm: Updated caller and used
      ASSERT_NO_EXCEPTION for nearby code.
      (WebCore::styleForSelectionStart):
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::setContentEditable):
      * inspector/InspectorDOMAgent.cpp:
      (WebCore::InspectorDOMAgent::setAttributesAsText):
      * svg/SVGAnimationElement.cpp:
      (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue):
      * svg/SVGElement.idl: Removed 'setter raises(DOMException)'
      * svg/SVGGlyphRefElement.idl: ditto.
      * svg/SVGStyleElement.cpp:
      (WebCore::SVGStyleElement::setType):
      (WebCore::SVGStyleElement::setMedia):
      (WebCore::SVGStyleElement::setTitle):
      * xml/parser/XMLTreeBuilder.cpp:
      (WebCore::XMLTreeBuilder::processAttributes):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3e1e12b9
    • commit-queue@webkit.org's avatar
      Add support for 8 bits strings to Document::isValidName() · 44da6440
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=74784
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2011-12-19
      Reviewed by Darin Adler.
      
      Source/WebCore:
      
      Avoid the conversion to 16bits when we are in the ASCII fast path,
      otherwise fallback to the Unicode testing in 16bits.
      
      * dom/Document.cpp:
      (WebCore::isValidNameASCII):
      (WebCore::Document::isValidName):
      
      LayoutTests:
      
      Add tests for valid and invalid names for nodes.
      
      * fast/dom/Document/createElement-invalid-names-expected.txt: Added.
      * fast/dom/Document/createElement-invalid-names.html: Added.
      * fast/dom/Document/createElement-valid-names-expected.txt: Added.
      * fast/dom/Document/createElement-valid-names.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      44da6440
  18. 18 Dec, 2011 2 commits
  19. 17 Dec, 2011 1 commit
    • kling@webkit.org's avatar
      Cache and reuse the HTMLAllCollection returned by document.all. · dc9f2ce1
      kling@webkit.org authored
      <http://webkit.org/b/74768>
      
      Reviewed by Antti Koivisto.
      
      Source/WebCore: 
      
      Let Document cache the document.all collection, just like we do for
      the other collections (.links, .images, etc.)
      This is primarily a memory optimization, as repeated calls to
      document.all will no longer cause collection objects to stack up.
      
      Tests: fast/dom/document-collection-idempotence.html
             fast/dom/gc-9.html
      
      * dom/Document.h:
      * dom/Document.cpp:
      (WebCore::Document::all):
      
          Cache the HTMLAllCollection and reuse it across calls instead of
          creating a new one each time.
      
      * html/HTMLAllCollection.h:
      * html/HTMLAllCollection.cpp:
      (WebCore::HTMLAllCollection::create):
      (WebCore::HTMLAllCollection::HTMLAllCollection):
      
          Make the HTMLAllCollection constructor take a Document* to enforce
          the fact that it's the only way it should ever be created.
      
      * html/HTMLAllCollection.idl:
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateImplementation):
      
          Custom reachability code for JSC, same as HTMLCollection.
      
      LayoutTests: 
      
      Update tests to document the new behavior of document.all.
      
      * fast/dom/document-collection-idempotence-expected.txt:
      * fast/dom/document-collection-idempotence.html:
      * fast/dom/gc-9-expected.txt:
      * fast/dom/gc-9.html:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103166 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dc9f2ce1
  20. 16 Dec, 2011 5 commits
    • commit-queue@webkit.org's avatar
      [MutationObservers] Remove platform-dependent code in Document.cpp resulting... · bfdd4724
      commit-queue@webkit.org authored
      [MutationObservers] Remove platform-dependent code in Document.cpp resulting from Mutation Event histogram collection
      https://bugs.webkit.org/show_bug.cgi?id=73026
      
      Patch by Rafael Weinstein <rafaelw@chromium.org> on 2011-12-16
      Reviewed by Ryosuke Niwa.
      
      This patch adds platform/HistogramSupport which has an empty implementation for all ports
      except Chromium.
      
      No tests need. This patch is just a refactor.
      
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.gypi:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/Document.cpp:
      (WebCore::histogramMutationEventUsage):
      (WebCore::Document::~Document):
      * platform/HistogramSupport.h: Added.
      (WebCore::HistogramSupport::histogramEnumeration):
      * platform/chromium/HistogramSupportChromium.cpp: Added.
      (WebCore::HistogramSupport::histogramEnumeration):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bfdd4724
    • beidson@apple.com's avatar
      <rdar://problem/10576732> and https://bugs.webkit.org/show_bug.cgi?id=74533 · a675a9d6
      beidson@apple.com authored
      REGRESSION(r102619): Reproducible crash closing window with video + poster image inside an object element
      
      Reviewed by Darin Adler.
      
      Source/WebCore: 
      
      Test: media/crash-closing-page-with-media-as-plugin-fallback.html
      
      At some point documentWillBecomeInactive() was overloaded to not only notify elements they were going in to the page
      cache but also do some other work that was necessary during Document teardown.
      
      This crash occurs because we're notifying elements they're going in to the page cache at document teardown, so this
      patch breaks that work back out in to a separate function.
      
      * dom/Document.cpp:
      (WebCore::Document::detach): Remove obsolete comment.
      (WebCore::Document::documentWillBecomeInactive): Handle only accelerated compositing cleanup.
      (WebCore::Document::documentWillSuspendForPageCache): Call documentWillBecomeInactive before notifying elements of suspension.
      (WebCore::Document::documentDidResumeFromPageCache):
      (WebCore::Document::registerForPageCacheSuspensionCallbacks):
      (WebCore::Document::unregisterForPageCacheSuspensionCallbacks):
      * dom/Document.h:
      
      * history/CachedFrame.cpp:
      (WebCore::CachedFrameBase::restore): Call the renamed documentDidResumeFromPageCache.
      (WebCore::CachedFrame::CachedFrame): Call documentWillSuspendForPageCache instead of documentDidBecomeInactive.
      
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::commitProvisionalLoad): Call the renamed documentDidResumeFromPageCache.
      
      * dom/Element.h:
      (WebCore::Element::documentWillSuspendForPageCache): Renamed from documentWillBecomeInactive()
      (WebCore::Element::documentDidResumeFromPageCache): Renamed from documentDidBecomeActive()
      
      Change to the renamed registration and callbacks functions in the handful of classes that use them:
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::~HTMLFormElement):
      (WebCore::HTMLFormElement::parseMappedAttribute):
      (WebCore::HTMLFormElement::documentDidResumeFromPageCache):
      (WebCore::HTMLFormElement::willMoveToNewOwnerDocument):
      (WebCore::HTMLFormElement::didMoveToNewOwnerDocument):
      * html/HTMLFormElement.h:
      
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::~HTMLInputElement):
      (WebCore::HTMLInputElement::updateType):
      (WebCore::HTMLInputElement::parseMappedAttribute):
      (WebCore::HTMLInputElement::needsSuspensionCallback):
      (WebCore::HTMLInputElement::registerForSuspensionCallbackIfNeeded):
      (WebCore::HTMLInputElement::unregisterForSuspensionCallbackIfNeeded):
      (WebCore::HTMLInputElement::documentDidResumeFromPageCache):
      (WebCore::HTMLInputElement::willMoveToNewOwnerDocument):
      (WebCore::HTMLInputElement::didMoveToNewOwnerDocument):
      * html/HTMLInputElement.h:
      
      * html/HTMLPlugInImageElement.cpp:
      (WebCore::HTMLPlugInImageElement::~HTMLPlugInImageElement):
      (WebCore::HTMLPlugInImageElement::createRenderer):
      (WebCore::HTMLPlugInImageElement::willMoveToNewOwnerDocument):
      (WebCore::HTMLPlugInImageElement::didMoveToNewOwnerDocument):
      (WebCore::HTMLPlugInImageElement::documentWillSuspendForPageCache):
      (WebCore::HTMLPlugInImageElement::documentDidResumeFromPageCache):
      * html/HTMLPlugInImageElement.h:
      
      * svg/SVGSVGElement.cpp:
      (WebCore::SVGSVGElement::SVGSVGElement):
      (WebCore::SVGSVGElement::~SVGSVGElement):
      (WebCore::SVGSVGElement::willMoveToNewOwnerDocument):
      (WebCore::SVGSVGElement::didMoveToNewOwnerDocument):
      (WebCore::SVGSVGElement::documentWillSuspendForPageCache):
      (WebCore::SVGSVGElement::documentDidResumeFromPageCache):
      * svg/SVGSVGElement.h:
      
      LayoutTests: 
      
      * media/crash-closing-page-with-media-as-plugin-fallback-expected.txt: Added.
      * media/crash-closing-page-with-media-as-plugin-fallback.html: Added.
      * media/resources/video-with-poster-as-object-fallback.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a675a9d6
    • kling@webkit.org's avatar
      Unreviewed debug build fix after r103115. · 66299d67
      kling@webkit.org authored
      * dom/Document.cpp:
      (WebCore::Document::cachedCollection):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103122 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      66299d67
    • kling@webkit.org's avatar
      Cache and reuse HTMLCollections exposed by Document. · 3e527e98
      kling@webkit.org authored
      <http://webkit.org/b/71956>
      
      Reviewed by Antti Koivisto.
      
      Source/WebCore: 
      
      Let Document cache the various HTMLCollection objects it exposes.
      This is a behavior change in two ways:
      
      1) The lifetime of returned collections is now tied to the lifetime
         of the Document. This matches the behavior of Firefox and Opera.
      
      2) The cached collections returned by document are now exactly equal
         to those returned by subsequent calls to the same getters.
      
      This reduces memory consumption by ~800 kB (on 64-bit) when loading
      the full HTML5 spec. document.links was called 34001 times, yielding
      34001 separate HTMLCollections, and now we only need 1.
      
      The document.all collection retains the old behavior, as caching it
      will be a bit more complicated.
      
      To avoid a reference cycle between Document and HTMLCollection,
      collections that are cached on Document do not retained their base
      node pointer (controlled by a m_baseIsRetained flag.)
      
      Tests: fast/dom/document-collection-idempotence.html
             fast/dom/gc-9.html
      
      * dom/Document.cpp:
      (WebCore::Document::detach):
      (WebCore::Document::cachedCollection):
      (WebCore::Document::images):
      (WebCore::Document::applets):
      (WebCore::Document::embeds):
      (WebCore::Document::plugins):
      (WebCore::Document::objects):
      (WebCore::Document::scripts):
      (WebCore::Document::links):
      (WebCore::Document::forms):
      (WebCore::Document::anchors):
      * dom/Document.h:
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::HTMLCollection):
      (WebCore::HTMLCollection::createForCachingOnDocument):
      (WebCore::HTMLCollection::~HTMLCollection):
      (WebCore::HTMLCollection::itemAfter):
      * html/HTMLCollection.h:
      (WebCore::HTMLCollection::base):
      
      LayoutTests: 
      
      Added a test to verify that collections returned by document (excluding .all)
      are equal to the collections returned by subsequent calls to the same getters.
      
      Also update fast/dom/gc-9.html to cover the new lifetime behavior of
      HTMLCollection objects returned by document.
      
      * fast/dom/document-collection-idempotence-expected.txt: Added.
      * fast/dom/document-collection-idempotence.html: Added.
      * fast/dom/gc-9-expected.txt:
      * fast/dom/gc-9.html:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3e527e98
    • kling@webkit.org's avatar
      Don't call Document::body() twice in the same function. · 156604cb
      kling@webkit.org authored
      <http://webkit.org/b/74683>
      
      Reviewed by Dan Bernstein.
      
      Document::body() is O(n), so we should avoid calling it multiple
      times unnecessarily.
      
      * dom/Document.cpp:
      (WebCore::Document::updateLayoutIgnorePendingStylesheets):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      156604cb
  21. 15 Dec, 2011 2 commits
    • adamk@chromium.org's avatar
      [MutationObservers] Add a document-level flag that can trivially be checked to... · c3168fb8
      adamk@chromium.org authored
      [MutationObservers] Add a document-level flag that can trivially be checked to avoid doing unnessary work if mutation observers absent
      https://bugs.webkit.org/show_bug.cgi?id=74641
      
      Patch by Rafael Weinstein <rafaelw@chromium.org> on 2011-12-15
      Reviewed by Ojan Vafai.
      
      This patch adds a byte of flags to Document, of which three bits are used to signal if any
      node owned by the document has a Mutation Observer of the given type. This is used to
      reduce the cost of discovering there are none to a single (inlined) method call and bit-check.
      Also, a similar byte of flags which was used to optimize a particular case when mutation observers
      are present has been removed, with the reasoning that we should first focus on minimizing impact on
      the null-case before optimizing particular in-use cases.
      
      Also, MutationObserverInterestGroup is broken out into its own file (which probably should have happened
      earlier, but now avoids a circular header dependency).
      
      No tests needed. This patch is just a refactor.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * css/CSSMutableStyleDeclaration.cpp:
      * dom/CharacterData.cpp:
      * dom/ChildListMutationScope.cpp:
      * dom/Document.cpp:
      (WebCore::Document::Document):
      * dom/Document.h:
      (WebCore::Document::hasMutationObserversOfType):
      (WebCore::Document::hasMutationObservers):
      (WebCore::Document::addMutationObserverTypes):
      * dom/Element.cpp:
      * dom/MutationObserverInterestGroup.cpp: Added.
      (WebCore::MutationObserverInterestGroup::createIfNeeded):
      (WebCore::MutationObserverInterestGroup::MutationObserverInterestGroup):
      (WebCore::MutationObserverInterestGroup::isOldValueRequested):
      (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
      * dom/MutationObserverInterestGroup.h: Copied from Source/WebCore/dom/WebKitMutationObserver.h.
      (WebCore::MutationObserverInterestGroup::createForChildListMutation):
      (WebCore::MutationObserverInterestGroup::createForCharacterDataMutation):
      (WebCore::MutationObserverInterestGroup::createForAttributesMutation):
      (WebCore::MutationObserverInterestGroup::hasOldValue):
      * dom/Node.cpp:
      (WebCore::Node::didMoveToNewOwnerDocument):
      (WebCore::Node::getRegisteredMutationObserversOfType):
      (WebCore::Node::notifyMutationObserversNodeWillDetach):
      * dom/Node.h:
      * dom/WebKitMutationObserver.cpp:
      (WebCore::WebKitMutationObserver::observe):
      * dom/WebKitMutationObserver.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c3168fb8
    • simonjam@chromium.org's avatar
      [Navigation Timing] Use monotonicallyIncreasingTime() instead of currentTime() · dfab5cf9
      simonjam@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=58354
      
      Reviewed by Pavel Feldman.
      
      Source/WebCore:
      
      No new tests. Relies on existing webtiming-* tests.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * WebCore.gypi:
      * WebCore.pro:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/Document.cpp: Use monotonic times.
      (WebCore::Document::setReadyState):
      (WebCore::Document::finishedParsing):
      * inspector/InspectorInstrumentation.cpp:
      (WebCore::InspectorInstrumentation::didFinishLoadingImpl): Convert monotonicFinishTime to wall time if needed.
      * inspector/InspectorResourceAgent.cpp:
      (WebCore::buildObjectForTiming): Convert monotonic requestTime to wall time.
      (WebCore::buildObjectForResourceResponse): Plumbing for above.
      (WebCore::buildObjectForCachedResource): Ditto.
      (WebCore::InspectorResourceAgent::willSendRequest): Ditto.
      (WebCore::InspectorResourceAgent::didReceiveResponse): Ditto.
      (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache): Ditto.
      * loader/DocumentLoadTiming.cpp: Added.
      (WebCore::DocumentLoadTiming::DocumentLoadTiming):
      (WebCore::DocumentLoadTiming::setNavigationStart): Determine reference time and root reference time.
      (WebCore::DocumentLoadTiming::addRedirect): Moved logic from MainResourceLoader.
      (WebCore::DocumentLoadTiming::convertMonotonicTimeToDocumentTime): Helper to compute wall time from monotonic time.
      * loader/DocumentLoadTiming.h: Turned into class. Made times monotonic.
      (WebCore::DocumentLoadTiming::setUnloadEventStart):
      (WebCore::DocumentLoadTiming::setUnloadEventEnd):
      (WebCore::DocumentLoadTiming::setRedirectStart):
      (WebCore::DocumentLoadTiming::setRedirectEnd):
      (WebCore::DocumentLoadTiming::setFetchStart):
      (WebCore::DocumentLoadTiming::setResponseEnd):
      (WebCore::DocumentLoadTiming::setLoadEventStart):
      (WebCore::DocumentLoadTiming::setLoadEventEnd):
      (WebCore::DocumentLoadTiming::setHasSameOriginAsPreviousDocument):
      (WebCore::DocumentLoadTiming::navigationStart):
      (WebCore::DocumentLoadTiming::unloadEventStart):
      (WebCore::DocumentLoadTiming::unloadEventEnd):
      (WebCore::DocumentLoadTiming::redirectStart):
      (WebCore::DocumentLoadTiming::redirectEnd):
      (WebCore::DocumentLoadTiming::redirectCount):
      (WebCore::DocumentLoadTiming::fetchStart):
      (WebCore::DocumentLoadTiming::responseEnd):
      (WebCore::DocumentLoadTiming::loadEventStart):
      (WebCore::DocumentLoadTiming::loadEventEnd):
      (WebCore::DocumentLoadTiming::hasCrossOriginRedirect):
      (WebCore::DocumentLoadTiming::hasSameOriginAsPreviousDocument):
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::stopLoading):
      (WebCore::FrameLoader::commitProvisionalLoad):
      (WebCore::FrameLoader::continueLoadAfterWillSubmitForm):
      (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
      * loader/MainResourceLoader.cpp:
      (WebCore::MainResourceLoader::continueAfterNavigationPolicy):
      (WebCore::MainResourceLoader::willSendRequest): Moved logic to DocumentLoadTiming.
      (WebCore::MainResourceLoader::didReceiveData): Use monotonic time.
      (WebCore::MainResourceLoader::didFinishLoading): Ditto.
      (WebCore::MainResourceLoader::load):
      * page/DOMWindow.cpp:
      (WebCore::DOMWindow::dispatchLoadEvent):
      * page/DOMWindow.h: Removed dispatchTimedEvent. It doesn't really help in the new model.
      * page/PerformanceNavigation.cpp:
      (WebCore::PerformanceNavigation::redirectCount):
      * page/PerformanceTiming.cpp: Removed skew correction code. This should never happen now.
      (WebCore::PerformanceTiming::navigationStart):
      (WebCore::PerformanceTiming::unloadEventStart):
      (WebCore::PerformanceTiming::unloadEventEnd):
      (WebCore::PerformanceTiming::redirectStart):
      (WebCore::PerformanceTiming::redirectEnd):
      (WebCore::PerformanceTiming::fetchStart):
      (WebCore::PerformanceTiming::responseEnd):
      (WebCore::PerformanceTiming::domLoading):
      (WebCore::PerformanceTiming::domInteractive):
      (WebCore::PerformanceTiming::domContentLoadedEventStart):
      (WebCore::PerformanceTiming::domContentLoadedEventEnd):
      (WebCore::PerformanceTiming::domComplete):
      (WebCore::PerformanceTiming::loadEventStart):
      (WebCore::PerformanceTiming::loadEventEnd):
      (WebCore::PerformanceTiming::resourceLoadTimeRelativeToAbsolute): Used for ResourceLoadTiming.
      (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds): Used for DocumentTiming and DocumentLoadTiming.
      * page/PerformanceTiming.h:
      * platform/network/ResourceLoadTiming.cpp:
      (WebCore::ResourceLoadTiming::convertResourceLoadTimeToDocumentTime):
      * platform/network/ResourceLoadTiming.h: Added helper function to convert to wall times. Added instructions for use.
      
      LayoutTests:
      
      * fast/dom/script-tests/webtiming.js: Current monotonic time is unknown until performance.now() is available. Use 0 until then.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102961 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dfab5cf9