Source/WebCore: Add UserAgentShadowDOM to FormControlElement just before adding AuthorShadowDOM
https://bugs.webkit.org/show_bug.cgi?id=90866

Reviewed by Hajime Morita.

It ensures that UserAgentShadowDOM is the oldest ShadowDOM.

To show ValidationMessage, WebKit adds a Shadow DOM to some of FormControlElements.
ValidationMessage assumes that the added Shadow DOM is the oldest, however, there was a case
that a page author might add a Shadow DOM before ValidationMessage adds a Shadow DOM.
It will break the assumption that the Shadow DOM added by ValidationMessage is the oldest.
So we have prohibited a page author adding a Shadow DOM to FormControlElement.

To add UserAgentShadowDOM, we use a callback which is called before a page author adding a Shadow DOM.
It adds a UserAgentShadowDOM if it does not exist, so we can ensure that UserAgentShadowDOM is the oldest.

Tests: fast/dom/shadow/input-with-validation-without-shadow.html
       fast/dom/shadow/input-with-validation.html
       fast/dom/shadow/shadowdom-for-button-complex-shadow.html
       fast/dom/shadow/shadowdom-for-button-only-shadow.html
       fast/dom/shadow/shadowdom-for-button-without-shadow.html
       fast/dom/shadow/shadowdom-for-fieldset-complex-shadow.html
       fast/dom/shadow/shadowdom-for-fieldset-only-shadow.html
       fast/dom/shadow/shadowdom-for-fieldset-without-shadow.html
       fast/dom/shadow/shadowdom-for-form-associated-element-useragent.html
       fast/dom/shadow/shadowdom-for-keygen-complex-shadow.html
       fast/dom/shadow/shadowdom-for-keygen-only-shadow.html
       fast/dom/shadow/shadowdom-for-keygen-without-shadow.html
       fast/dom/shadow/shadowdom-for-object-complex-shadow.html
       fast/dom/shadow/shadowdom-for-object-only-shadow.html
       fast/dom/shadow/shadowdom-for-object-without-shadow.html
       fast/dom/shadow/shadowdom-for-output-complex-shadow.html
       fast/dom/shadow/shadowdom-for-output-only-shadow.html
       fast/dom/shadow/shadowdom-for-output-without-shadow.html
       fast/dom/shadow/shadowdom-for-select-complex-shadow.html
       fast/dom/shadow/shadowdom-for-select-only-shadow.html
       fast/dom/shadow/shadowdom-for-select-without-shadow.html
       fast/dom/shadow/shadowdom-for-textarea-complex-shadow.html
       fast/dom/shadow/shadowdom-for-textarea-only-shadow.html
       fast/dom/shadow/shadowdom-for-textarea-without-shadow.html

* dom/ShadowRoot.cpp:
(WebCore::allowsAuthorShadowRoot):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::ensureUserAgentShadowRoot): Ensures the existence of a UserAgentShadowRoot.
If it does not exist, we create it with empty content.
(WebCore):
* html/FormAssociatedElement.h:
(FormAssociatedElement):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::willAddAuthorShadowRoot):
(WebCore):
* html/HTMLFormControlElement.h:
(HTMLFormControlElement):
* html/ValidationMessage.cpp:
(WebCore::adjustBubblePosition): When AuthroShadowRoot does not a shadow element, ValidationMessage
does not have a renderer. So we have to check the existence of renderer.
(WebCore::ValidationMessage::buildBubbleTree):

LayoutTests: Add UserAgentShadowDOM to FormControlElement just before ading UserShadowDOM
https://bugs.webkit.org/show_bug.cgi?id=90866

Reviewed by Hajime Morita.

Added a lot of tests of ShadowDOM for replaced elements. They don't crash,
but many of them are not rendered correctly. Please see Bug 82313,
which is a meta bug of Shadow DOM for replaced elements.

* fast/dom/shadow/input-with-validation-expected.html: Added.
* fast/dom/shadow/input-with-validation-without-shadow-expected.html: Added.
* fast/dom/shadow/input-with-validation-without-shadow.html: Added.
* fast/dom/shadow/input-with-validation.html: Added.
* fast/dom/shadow/shadow-disable-expected.txt:
* fast/dom/shadow/shadow-disable.html:
* fast/dom/shadow/shadowdom-for-button-complex-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-button-complex-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-button-only-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-button-only-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-button-without-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-button-without-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-fieldset-complex-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-fieldset-complex-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-fieldset-only-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-fieldset-only-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-fieldset-without-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-fieldset-without-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-form-associated-element-useragent-expected.txt: Added.
* fast/dom/shadow/shadowdom-for-form-associated-element-useragent.html: Added.
* fast/dom/shadow/shadowdom-for-keygen-complex-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-keygen-complex-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-keygen-only-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-keygen-only-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-keygen-without-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-keygen-without-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-object-complex-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-object-complex-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-object-only-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-object-only-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-object-without-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-object-without-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-output-complex-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-output-complex-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-output-only-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-output-only-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-output-without-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-output-without-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-select-complex-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-select-complex-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-select-only-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-select-only-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-select-without-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-select-without-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-textarea-complex-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-textarea-complex-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-textarea-only-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-textarea-only-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-textarea-without-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-textarea-without-shadow.html: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/qt/Skipped:
* platform/wincairo/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix null ptr deref in CSSParser::storeVariableDeclaration().
https://bugs.webkit.org/show_bug.cgi?id=92333

Reviewed by Andreas Kling.

Fix null pointer deref that occurs if the CSSParserValue couldn't be converted to a CSSValue.

Test fast/css/variables/variable-unparseable-value-crash.html added.

* css/CSSParser.cpp:
(WebCore::CSSParser::storeVariableDeclaration):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Resource agent's reference to cached resources should be weak.
https://bugs.webkit.org/show_bug.cgi?id=92108

Reviewed by Pavel Feldman.

Source/WebCore:

NetworkResourcesData now stores a raw pointer to CachedResource.
CachedResource now notifies InspectorInstrumentation that it will be destroyed.
InspectorInstrumentation stores a set of InstrumentingAgents and broadcasts willDestroyCachedResource event to all available resourceAgents.
Destroyed resources content is saved to NetworkResourcesData.
Changed content size variables type in NetworkResourcesData from int to size_t.

Tests: http/tests/inspector/network/cached-resource-destroyed-moved-to-storage.html
       http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::inspectedPageDestroyed):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::willDestroyCachedResourceImpl):
(WebCore::InspectorInstrumentation::registerInstrumentingAgents):
(WebCore::InspectorInstrumentation::unregisterInstrumentingAgents):
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::willDestroyCachedResource):
(WebCore):
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::didReceiveData):
(WebCore::InspectorResourceAgent::willDestroyCachedResource):
(WebCore):
(WebCore::InspectorResourceAgent::getResponseBody):
* inspector/InspectorResourceAgent.h:
(InspectorResourceAgent):
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::ResourceData::ResourceData):
(WebCore::NetworkResourcesData::ResourceData::setContent):
(WebCore::NetworkResourcesData::ResourceData::dataLength):
(WebCore::NetworkResourcesData::ResourceData::appendData):
(WebCore::NetworkResourcesData::ResourceData::decodeDataToContent):
(WebCore::NetworkResourcesData::setResourceContent):
(WebCore::NetworkResourcesData::maybeAddResourceData):
(WebCore::NetworkResourcesData::maybeDecodeDataToContent):
(WebCore::NetworkResourcesData::removeCachedResource):
(WebCore):
(WebCore::NetworkResourcesData::setResourcesDataSizeLimits):
(WebCore::NetworkResourcesData::ensureFreeSpace):
* inspector/NetworkResourcesData.h:
(ResourceData):
(WebCore::NetworkResourcesData::ResourceData::base64Encoded):
(WebCore::NetworkResourcesData::ResourceData::cachedResource):
(NetworkResourcesData):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::~CachedResource):
(WebCore::CachedResource::removeClient):
(WebCore::CachedResource::deleteIfPossible):
* loader/cache/CachedResource.h:
(CachedResource):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::garbageCollectDocumentResourcesTimerFired):
(WebCore::CachedResourceLoader::garbageCollectDocumentResources):
(WebCore::CachedResourceLoader::clearPreloads):
* loader/cache/CachedResourceLoader.h:
(CachedResourceLoader):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::evict):
* testing/InternalSettings.cpp:
* testing/Internals.cpp:
(WebCore::Internals::garbageCollectDocumentResources):
(WebCore):
* testing/Internals.h:
(Internals):

LayoutTests:

* http/tests/inspector/network/cached-resource-destroyed-moved-to-storage-expected.txt: Added.
* http/tests/inspector/network/cached-resource-destroyed-moved-to-storage.html: Added.
* http/tests/inspector/network/cached-resource-destroyed-too-big-discarded-expected.txt: Added.
* http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add *explicit* keyword to constructors in WebCore/platform
https://bugs.webkit.org/show_bug.cgi?id=92238

Reviewed by Kentaro Hara.

As a step to let *explicit* keyword add to constructors which have a parameter,
*explicit* keyword is added to Source/WebCore/platform in order to avoid implicit
type conversion.

Some files in platform directory can't use explicit keyword because of build breaks.

No new tests. Covered by existing tests.

* platform/AutodrainedPool.h:
(AutodrainedPool):
* platform/ContentType.h:
(ContentType):
* platform/ContextMenu.h:
(ContextMenu):
* platform/ContextMenuItem.h:
(ContextMenuItem):
* platform/Cursor.h:
(WebCore::SharedCursor::SharedCursor):
(Cursor):
* platform/KURL.h:
(WebCore::KURL::KURL):
(KURL):
* platform/KURLGooglePrivate.h:
(KURLGooglePrivate):
* platform/PODRedBlackTree.h:
(WebCore::PODRedBlackTree::PODRedBlackTree):
* platform/Pasteboard.h:
(Pasteboard):
* platform/PlatformEvent.h:
(WebCore::PlatformEvent::PlatformEvent):
* platform/PlatformKeyboardEvent.h:
(PlatformKeyboardEvent):
* platform/PlatformMouseEvent.h:
(PlatformMouseEvent):
* platform/PlatformPasteboard.h:
(PlatformPasteboard):
* platform/PlatformTouchEvent.h:
(PlatformTouchEvent):
* platform/PlatformWheelEvent.h:
(PlatformWheelEvent):
* platform/RunLoop.h:
(TimerBase):
* platform/ScrollAnimator.h:
(ScrollAnimator):
* platform/ScrollAnimatorNone.h:
(ScrollAnimatorNone):
* platform/SharedBuffer.h:
(SharedBuffer):
* platform/WheelFlingPlatformGestureCurve.h:
(WheelFlingPlatformGestureCurve):
* platform/Widget.h:
(Widget):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123716 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Skip the failing tests.

* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Fix build break on Apple win bot after r123711
https://bugs.webkit.org/show_bug.cgi?id=92354

Reviewed by Adam Barth.

Missing return value.

* WebFrame.cpp:
(WebFrame::pageNumberForElementById):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r123715.
http://trac.webkit.org/changeset/123715
https://bugs.webkit.org/show_bug.cgi?id=92356

Breaks compilation on multiple platforms (Requested by vsevik
on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-07-26

Source/WebCore:

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::inspectedPageDestroyed):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentation):
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::didReceiveData):
(WebCore::InspectorResourceAgent::getResponseBody):
* inspector/InspectorResourceAgent.h:
(InspectorResourceAgent):
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::ResourceData::ResourceData):
(WebCore::NetworkResourcesData::ResourceData::setContent):
(WebCore::NetworkResourcesData::ResourceData::dataLength):
(WebCore::NetworkResourcesData::ResourceData::appendData):
(WebCore::NetworkResourcesData::ResourceData::decodeDataToContent):
(WebCore::NetworkResourcesData::setResourceContent):
(WebCore::NetworkResourcesData::maybeAddResourceData):
(WebCore::NetworkResourcesData::maybeDecodeDataToContent):
(WebCore::NetworkResourcesData::setResourcesDataSizeLimits):
(WebCore::NetworkResourcesData::ensureFreeSpace):
* inspector/NetworkResourcesData.h:
(ResourceData):
(WebCore::NetworkResourcesData::ResourceData::cachedResource):
(NetworkResourcesData):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::~CachedResource):
(WebCore::CachedResource::removeClient):
(WebCore::CachedResource::deleteIfPossible):
* loader/cache/CachedResource.h:
(CachedResource):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::garbageCollectDocumentResourcesTimerFired):
(WebCore::CachedResourceLoader::clearPreloads):
* loader/cache/CachedResourceLoader.h:
(CachedResourceLoader):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::evict):
* testing/InternalSettings.cpp:
* testing/Internals.cpp:
* testing/Internals.h:
(Internals):

LayoutTests:

* http/tests/inspector/network/cached-resource-destroyed-moved-to-storage-expected.txt: Removed.
* http/tests/inspector/network/cached-resource-destroyed-moved-to-storage.html: Removed.
* http/tests/inspector/network/cached-resource-destroyed-too-big-discarded-expected.txt: Removed.
* http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Added Qt5 specific expected results and png.

Patch by Ádám Kallai <kadam@inf.u-szeged.hu> on 2012-07-26

* platform/qt-5.0-wk2/fast/block/float/overhanging-tall-block-expected.png: Added after r123551.
* platform/qt-5.0-wk2/fast/block/float/overhanging-tall-block-expected.txt: Added after r123551.
* platform/qt-5.0-wk2/platform/qt/plugins/application-plugin-plugins-disabled-expected.png: Added after r123514.
* platform/qt-5.0-wk2/platform/qt/plugins/application-plugin-plugins-disabled-expected.txt: Update after r123514.
* platform/qt-5.0/css2.1/t0805-c5519-brdr-r-01-e-expected.png: Added after r123631.
* platform/qt-5.0/css2.1/t0805-c5519-brdr-r-01-e-expected.txt: Added after r123631.
* platform/qt-5.0/css2.1/t0905-c5525-fltblck-00-d-ag-expected.png: Added after r123631.
* platform/qt-5.0/css2.1/t0905-c5525-fltblck-00-d-ag-expected.txt: Added after r123631.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fix build break on mac win port by r123716.

* platform/KURL.h:
(KURL):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: CSP 1.1: Implement the Content Security Policy script interface.
https://bugs.webkit.org/show_bug.cgi?id=91707

Patch by Mike West <mkwst@chromium.org> on 2012-07-26
Reviewed by Adam Barth.

The CSP 1.1 editor's draft defines a script interface that gives
developers the ability to query a document regarding the restrictions
set by it's currently active content security policy[1]. This patch
exposes that API in terms of a new DOMSecurityPolicy object.

Data for the API is gathered from the existing ContentSecurityPolicy
object on the containing document. CSP's various methods have been
extended with a `reportingStatus` parameter which, unsurprisingly,
determines whether a violation report should be sent for blocked
resources. This allows us to reuse the same codepaths by simply using
ContentSecurityPolicy::SuppressReport when querying on behalf of the
API, and ContentSecurityPolicy::SendReport when checking resources a
page wants to load.

This feature is gated on the CSP_NEXT flag, which is currently disabled
for all ports other than Chromium.

[1]: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#script-interfaces--experimental

Tests: http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowconnectionto.html
       http/tests/security/contentSecurityPolicy/1.1/securitypolicy-alloweval.html
       http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowfontfrom.html
       http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowframefrom.html
       http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowimagefrom.html
       http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowmediafrom.html
       http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowobjectfrom.html
       http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowscriptfrom.html
       http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowstylefrom.html
       http/tests/security/contentSecurityPolicy/1.1/securitypolicy-isactive.html
       http/tests/security/contentSecurityPolicy/1.1/securitypolicy-reporturi.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* WebCore.gypi:
* bindings/gobject/GNUmakefile.am:
* WebCore.xcodeproj/project.pbxproj:
    We added a new object, so let's tell _everyone!_
* dom/Document.cpp:
(WebCore::Document::securityPolicy):
    Expose the SecurityPolicy object via Document, gated on CSP_NEXT.
(WebCore):
* dom/Document.h:
(WebCore):
(Document):
* dom/Document.idl:
    Adding the SecurityPolicy object to the document, gated on CSP_NEXT.
* page/ContentSecurityPolicy.cpp:
(CSPDirectiveList):
(WebCore::CSPDirectiveList::checkInline):
(WebCore::CSPDirectiveList::checkNonce):
(WebCore::CSPDirectiveList::checkSource):
    Extracting the core checks out into separate methods.
(WebCore::CSPDirectiveList::checkEvalAndReportViolation):
    Use checkEval.
(WebCore::CSPDirectiveList::checkNonceAndReportViolation):
    Use checkNonce.
(WebCore::CSPDirectiveList::checkInlineAndReportViolation):
    Use checkInline.
(WebCore::CSPDirectiveList::checkSourceAndReportViolation):
    Use checkSource.
(WebCore::CSPDirectiveList::allowJavaScriptURLs):
(WebCore::CSPDirectiveList::allowInlineEventHandlers):
(WebCore::CSPDirectiveList::allowInlineScript):
(WebCore::CSPDirectiveList::allowInlineStyle):
(WebCore::CSPDirectiveList::allowEval):
(WebCore::CSPDirectiveList::allowScriptFromSource):
(WebCore::CSPDirectiveList::allowObjectFromSource):
(WebCore::CSPDirectiveList::allowChildFrameFromSource):
(WebCore::CSPDirectiveList::allowImageFromSource):
(WebCore::CSPDirectiveList::allowStyleFromSource):
(WebCore::CSPDirectiveList::allowFontFromSource):
(WebCore::CSPDirectiveList::allowMediaFromSource):
(WebCore::CSPDirectiveList::allowConnectToSource):
    These methods now branch on `reportingStatus`: if `SendReoport`,
    they call `checkXAndReportViolation`, otherwise, they call `checkX`.
(WebCore::CSPDirectiveList::gatherReportURIs):
    New method that gathers the violation report URIs into a DOMStringList.
(WebCore::isAllowedByAllWithCallStack):
(WebCore::isAllowedByAllWithContext):
(WebCore::isAllowedByAllWithURL):
    These now pass reportingStatus through to the various `allowX` methods.
(WebCore::ContentSecurityPolicy::allowJavaScriptURLs):
(WebCore::ContentSecurityPolicy::allowInlineEventHandlers):
(WebCore::ContentSecurityPolicy::allowInlineScript):
(WebCore::ContentSecurityPolicy::allowInlineStyle):
(WebCore::ContentSecurityPolicy::allowEval):
(WebCore::ContentSecurityPolicy::allowScriptFromSource):
(WebCore::ContentSecurityPolicy::allowObjectFromSource):
(WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
(WebCore::ContentSecurityPolicy::allowImageFromSource):
(WebCore::ContentSecurityPolicy::allowStyleFromSource):
(WebCore::ContentSecurityPolicy::allowFontFromSource):
(WebCore::ContentSecurityPolicy::allowMediaFromSource):
(WebCore::ContentSecurityPolicy::allowConnectToSource):
    These accept a new `reportingStatus` parameter, which is passed through
    to the CSPDirectiveList methods.
(WebCore::ContentSecurityPolicy::isActive):
    New method that returns `true` if policy is active.
(WebCore::ContentSecurityPolicy::gatherReportURIs):
    New method that returns a DOMStringList of violation report URIs.
* page/ContentSecurityPolicy.h:
(WebCore):
* page/DOMSecurityPolicy.cpp: Added.
(WebCore::DOMSecurityPolicy::DOMSecurityPolicy):
(WebCore):
(WebCore::DOMSecurityPolicy::~DOMSecurityPolicy):
(WebCore::DOMSecurityPolicy::isActive):
(WebCore::DOMSecurityPolicy::reportURIs):
(WebCore::DOMSecurityPolicy::allowsInlineScript):
(WebCore::DOMSecurityPolicy::allowsInlineStyle):
(WebCore::DOMSecurityPolicy::allowsEval):
(WebCore::DOMSecurityPolicy::allowsConnectionTo):
(WebCore::DOMSecurityPolicy::allowsFontFrom):
(WebCore::DOMSecurityPolicy::allowsFrameFrom):
(WebCore::DOMSecurityPolicy::allowsImageFrom):
(WebCore::DOMSecurityPolicy::allowsMediaFrom):
(WebCore::DOMSecurityPolicy::allowsObjectFrom):
(WebCore::DOMSecurityPolicy::allowsScriptFrom):
(WebCore::DOMSecurityPolicy::allowsStyleFrom):
* page/DOMSecurityPolicy.h: Added.
(WebCore):
(DOMSecurityPolicy):
(WebCore::DOMSecurityPolicy::create):
* page/DOMSecurityPolicy.idl: Added.

LayoutTests: Implement the experimental Content Security Policy script interface.
https://bugs.webkit.org/show_bug.cgi?id=91707

Patch by Mike West <mkwst@chromium.org> on 2012-07-26
Reviewed by Adam Barth.

* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowconnectionto-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowconnectionto.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-alloweval-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-alloweval.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowfontfrom-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowfontfrom.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowframefrom-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowframefrom.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowimagefrom-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowimagefrom.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowmediafrom-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowmediafrom.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowobjectfrom-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowobjectfrom.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowscriptfrom-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowscriptfrom.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowstylefrom-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-allowstylefrom.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-isactive-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-isactive.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-reporturi-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicy-reporturi.html: Added.
* http/tests/security/contentSecurityPolicy/resources/securitypolicy-tests-base.js: Added.
(log):
(injectPolicy):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123722 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Regression(r123604): webintents/web-intents-obj-constructor.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=92349

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-07-26
Reviewed by Kentaro Hara.

Fix crash occurring after r123604, which replaced strdup()
usage with eina_stringshare_add(). Unfortunately, the DRT
was not updated accordingly to use eina_stringshare_del()
instead of free() on the values returned by Ewk_Intent
getters and it was causing
webintents/web-intents-obj-constructor.html to crash.

* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::onFrameIntentNew):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaStream API: Remove DeprecatedPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=92106

Reviewed by Adam Barth.

Source/WebCore:

Since we are getting ready to add an updated PeerConnection
the old DeprecatedPeerConnection will have to go.

No new tests, and old tests converted to use PeerConnection00.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Modules/mediastream/DOMWindowMediaStream.idl:
* Modules/mediastream/DeprecatedPeerConnection.cpp: Removed.
* Modules/mediastream/DeprecatedPeerConnection.h: Removed.
* Modules/mediastream/DeprecatedPeerConnection.idl: Removed.
* Modules/mediastream/SignalingCallback.h: Removed.
* Modules/mediastream/SignalingCallback.idl: Removed.
* PlatformBlackBerry.cmake:
* PlatformEfl.cmake:
* UseJSC.cmake:
* WebCore.gypi:
* bindings/generic/RuntimeEnabledFeatures.h:
* bindings/js/JSDeprecatedPeerConnectionCustom.cpp: Removed.
* dom/EventTargetFactory.in:
* platform/mediastream/DeprecatedPeerConnectionHandler.h: Removed.
* platform/mediastream/DeprecatedPeerConnectionHandlerClient.h: Removed.
* platform/mediastream/blackberry/DeprecatedPeerConnectionHandler.cpp: Removed.
* platform/mediastream/chromium/DeprecatedPeerConnectionHandler.cpp: Removed.
* platform/mediastream/chromium/DeprecatedPeerConnectionHandlerInternal.cpp: Removed.
* platform/mediastream/chromium/DeprecatedPeerConnectionHandlerInternal.h: Removed.
* platform/mediastream/gstreamer/DeprecatedPeerConnectionHandler.cpp: Removed.

LayoutTests:

Changed all usages of DeprecatedPeerConnection to PeerConnection00.

* fast/dom/call-a-constructor-as-a-function-expected.txt:
* fast/dom/call-a-constructor-as-a-function.html:
* fast/mediastream/peerconnection-addstream-expected.txt:
* fast/mediastream/peerconnection-argument-types-expected.txt:
* fast/mediastream/peerconnection-eventlistener-optional-argument.html:
* fast/mediastream/peerconnection-mediastreamlist.html:
* fast/mediastream/peerconnection-removestream-expected.txt:
* fast/mediastream/script-tests/peerconnection-addstream.js:
* fast/mediastream/script-tests/peerconnection-argument-types.js:
* fast/mediastream/script-tests/peerconnection-removestream.js:
* platform/chromium/fast/dom/call-a-constructor-as-a-function-expected.txt:
* platform/gtk/fast/dom/call-a-constructor-as-a-function-expected.txt:
* platform/gtk/fast/js/global-constructors-expected.txt:
* platform/win/fast/dom/call-a-constructor-as-a-function-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[DRT] LTC:: pageNumberForElementById() could be moved to Internals
https://bugs.webkit.org/show_bug.cgi?id=92091

Reviewed by Kentaro Hara.

Missing a symbol filter for Mac win port.

* win/WebKit2.def:
* win/WebKit2CFLite.def:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: add memory reporting routine to StyleResolver
https://bugs.webkit.org/show_bug.cgi?id=92259

Reviewed by Vsevolod Vlasov.

SyleResolver::reportMemoryUsage is added for estimating StyleResolver
memory footprint.

* css/StyleResolver.cpp:
(RuleData):
(RuleSet):
(RuleSetSelectorPair):
(WebCore::StyleResolver::Features::reportMemoryUsage):
(WebCore):
(WebCore::StyleResolver::collectMatchingRulesForList):
* css/StyleResolver.h:
(Features):
(StyleResolver):
* dom/Document.cpp:
(WebCore::Document::reportMemoryUsage):
* dom/MemoryInstrumentation.h:
(MemoryInstrumentation):
(WebCore::MemoryClassInfo::addInstrumentedHashSet):
(WebCore::MemoryClassInfo::addInstrumentedVector):
(WebCore::MemoryInstrumentation::addHashMap):
(WebCore):
(WebCore::MemoryInstrumentation::addInstrumentedCollection):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] [WK2] Memory leak in ewk_view_resource_load_client.cpp
https://bugs.webkit.org/show_bug.cgi?id=92099

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-07-26
Reviewed by Kentaro Hara.

Fix a memory leak by clearing the loadingResources HashMap on exit.

* UIProcess/API/efl/ewk_view.cpp:
(_Ewk_View_Private_Data::~_Ewk_View_Private_Data):
(_ewk_view_priv_loading_resources_clear):
(ewk_view_load_provisional_started):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Gardening after r123634
https://bugs.webkit.org/show_bug.cgi?id=92351

Unreviewed gardening.

Newly added inspector tests failing on EFL port due to missing Geolocation support (bug 82140).
Moved Geolocation tests to TestExpectations from Skipped.

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-07-26

* platform/efl/Skipped:
* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[NRWT] should have a way to restrict pixel tests for individual directories
https://bugs.webkit.org/show_bug.cgi?id=91754

Reviewed by Dirk Pranke.

Added --pixel-test-directories option to nrwt. It implies --pixel-tests.
If the platform supports this option only tests from these directories will
be executed as pixel tests. Furthermore, platforms can have a default set of
pixel test directories. To support the feature the test harness have to be
able to inform the driver whether to dump pixels for each tests. For this
purpose I changed WTR and the Qt DRT to handle a --pixel-test argument from
the standard output and made NRWT use this argument with these drivers.

* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::DumpRenderTree):
(WebCore::DumpRenderTree::open):
(WebCore::DumpRenderTree::processLine):
(WebCore::DumpRenderTree::setDumpPixelsForAllTests):
(WebCore::DumpRenderTree::dump):
* DumpRenderTree/qt/DumpRenderTreeQt.h:
(DumpRenderTree):
* DumpRenderTree/qt/main.cpp:
(main):
Handle the --pixel-test argument.

* Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
(SingleTestRunner._should_fetch_expected_checksum):
(SingleTestRunner._overwrite_baselines):
(SingleTestRunner._compare_output):
* Scripts/webkitpy/layout_tests/controllers/worker.py:
(Worker._update_test_input):
* Scripts/webkitpy/layout_tests/port/base.py:
(Port.supports_switching_pixel_tests_per_test): Ports can override this to inform
the harness that --pixel-test argument is supported. True for WTR, otherwise calls
private version that can be overridden by the actual platform. Only true with WTR
and Qt DRT currently. This supposed to exist only temporary until there are ports
that doesn't support the feature in their DRT's.
(Port):
(Port._supports_switching_pixel_tests_per_test):
(Port.should_run_as_pixel_test):
(Port._should_run_as_pixel_test): Ports can override this to define their
default set of pixel tests directories.
* Scripts/webkitpy/layout_tests/port/driver.py:
(Driver.cmd_line): Don't pass --pixel-tests if the platform supports per test
--pixel-test.
(Driver._command_from_driver_input): Pass --pixel-test if it is supported and pixel
tests are enabled.
* Scripts/webkitpy/layout_tests/port/qt.py:
(QtPort.check_sys_deps):
(QtPort):
(QtPort._supports_switching_pixel_tests_per_test):
(QtPort._should_run_as_pixel_test):
(QtPort._default_pixel_test_directories): Only compositing will be our default pixel
test directory for the time being.
* Scripts/webkitpy/layout_tests/port/test.py:
(TestPort.supports_switching_pixel_tests_per_test):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(_set_up_derived_options):
(parse_args):
Handle the --pixel-test-directory option. It expect a directory below LayoutTests
and can be specified multiple times. Added fixme's that we should improve how we
handle these arguments.

* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(MainTest.test_run_singly_actually_runs_tests):
(MainTest.test_pixel_test_directories):
Added an integration test for the feature.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::TestController):
(WTR::TestController::initialize):
(WTR::TestController::runTest):
* WebKitTestRunner/TestController.h:
(TestController):
Handle the --pixel-test argument.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2% of all samples running grid demo show up in StyleResolver::canShareStyleWithElement, 20% of those due to getAttribute instead of fastGetAttribute
https://bugs.webkit.org/show_bug.cgi?id=92257

Reviewed by Andreas Kling.

This check was added 7 years ago by hyatt in:
http://trac.webkit.org/changeset/10984
And then later made slow after triggering an ASSERT added:
http://trac.webkit.org/changeset/97670

SVG uses a "type" attribute (and it is animatable), but only when
used on filter elements:
http://www.w3.org/TR/SVG/attindex.html
In any case, this does not apply here, and is certainly not what
this check was originally intended for.

I've moved the check to canShareStyleWithControl
as it is only needed when the elements in question are both input elements.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] EFL port should use XDG paths
https://bugs.webkit.org/show_bug.cgi?id=91719

Patch by Zoltan Nyul <zoltan.nyul@intel.com> on 2012-07-26
Reviewed by Kenneth Rohde Christiansen.

.:

Efreet library added.

* Source/cmake/FindEFL.cmake:

Source/WebKit:

Add efreet library to get the xdg paths.

* PlatformEfl.cmake:

Source/WebKit/efl:

Using xdg paths instead of home/.webkit directory for application
cache, web-database and local-storage.

* ewk/ewk_main.cpp:
(_ewk_init_body):

Source/WebKit2:

Setting xdg paths for application cache, web-database and local-storage.

* PlatformEfl.cmake:
* UIProcess/efl/WebContextEfl.cpp:
(WebKit::WebContext::applicationCacheDirectory):
(WebKit::WebContext::platformDefaultDatabaseDirectory):
(WebKit::WebContext::platformDefaultLocalStorageDirectory):

Tools:

The appcache/localstorage/webdatabase path should be set in the
ewk_main.cpp instead of the DumpRenderTree, and the XDG_DATA_HOME and
XDG_CACHE_HOME should be set to different directory for each processes
for the layout-tests.

* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::initialize):
* Scripts/webkitpy/layout_tests/port/efl.py:
(EflPort.setup_environ_for_server):
* efl/jhbuild.modules:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] WebPage::handleEditingKeyboardEvent does not check whether the node allows editing.
https://bugs.webkit.org/show_bug.cgi?id=92364

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-07-26
Reviewed by Kenneth Rohde Christiansen.

Added a check whether the input node allows editing. If editing is not allowed
text input event will not be emitted.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::handleEditingKeyboardEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123732 268f45cc-cd09-0410-ab3c-d52691b4dbfc