Add ClipPathOperation for -webkit-clip-path organization
https://bugs.webkit.org/show_bug.cgi?id=95619

Reviewed by Dean Jackson.

This patch adds a new class ClipPathOperation to manage the values of the
-webkit-clip-path property. ClipPathOperation stores a Path object for clipping and is
a preparation for IRI references of the SVG 'clipPath' element.

The structure of ClipPathOperation is simular to FilterOperation.

ClipPathOperation will be extended to support IRI references directly in a second patch.

No new tests. The changes just affect the backend.

* GNUmakefile.list.am: Added new ClipPathOperation class.
* WebCore.gypi: Ditto.
* WebCore.vcproj/WebCore.vcproj: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* css/CSSComputedStyleDeclaration.cpp: Use ClipPathOperation instead of BasicShape.
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Ditto.
* css/StyleBuilder.cpp: Ditto.
(WebCore):
(WebCore::ApplyPropertyClipPath::setValue):
(WebCore::ApplyPropertyClipPath::applyValue):
(WebCore::ApplyPropertyClipPath::createHandler):
* rendering/ClipPathOperation.h: Added. New handler for property values (BasicShape, references).
(WebCore):
(ClipPathOperation):
(WebCore::ClipPathOperation::~ClipPathOperation):
(WebCore::ClipPathOperation::operator!=):
(WebCore::ClipPathOperation::getOperationType): Return the operation type.
(WebCore::ClipPathOperation::isSameType): Helper function for =operator.
(WebCore::ClipPathOperation::ClipPathOperation):
(ShapeClipPathOperation): Inheriting class for managing BasicShapes.
(WebCore::ShapeClipPathOperation::create):
(WebCore::ShapeClipPathOperation::basicShape):
(WebCore::ShapeClipPathOperation::windRule):
(WebCore::ShapeClipPathOperation::path):
(WebCore::ShapeClipPathOperation::operator==):
(WebCore::ShapeClipPathOperation::ShapeClipPathOperation):
* rendering/RenderLayer.cpp: Use ClipPathOperation to apply clipping.
(WebCore::RenderLayer::paintLayerContents):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.h:
(StyleRareNonInheritedData):
* rendering/svg/SVGRenderingContext.cpp: Ditto.
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build with WTF URL
https://bugs.webkit.org/show_bug.cgi?id=96875

Reviewed by Adam Barth.

Source/WebCore: 

Fix reportMemoryUsage, the implementation was only partial.

* WebCore.exp.in: Export two more symbols as needed by API tests.
* platform/KURLWTFURL.cpp:
(WebCore::KURL::string): emptyString() return a reference,
it makes more sense than nullAtom() here.
* platform/KURLWTFURLImpl.h:
(WebCore::KURLWTFURLImpl::reportMemoryUsage):

Source/WTF: 

Add support for MemoryInstrumentation to WTF's URL classes.

* wtf/url/api/ParsedURL.cpp:
(WTF::ParsedURL::reportMemoryUsage):
* wtf/url/api/ParsedURL.h:
(ParsedURL):
* wtf/url/api/URLString.cpp:
(WTF::URLString::reportMemoryUsage):
* wtf/url/api/URLString.h:
(URLString):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<use> not working when the SVG doc is embedded as <object> data
https://bugs.webkit.org/show_bug.cgi?id=96816

Reviewed by Dirk Schulze.

Source/WebCore:

Updated SVGURIReference::isExternalURIReference() to correctly classify fragment-only URIs.
Also, since the fragment-only test is cheap, it should be the first thing to try.

Test: svg/custom/object-data-href.html

* svg/SVGURIReference.h:
(WebCore::SVGURIReference::isExternalURIReference):

LayoutTests:

* svg/custom/object-data-href-expected.html: Added.
* svg/custom/object-data-href.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Pause inspector when inline scripts are blocked by Content Security Policy.
https://bugs.webkit.org/show_bug.cgi?id=93865

Patch by Mike West <mkwst@chromium.org> on 2012-09-15
Reviewed by Pavel Feldman.

When Content Security Policy blocks an inline script that's been
injected after the document is parsed, a fairly unhelpful console
warning is generated; it points at line 1, regardless of where the error
occurred. This patch adjusts CSP to not only warn on the console, but
also to notify the inspector that it should pause execution if the
developer has toggled "Break on Exceptions". Developers will have a
better chance of tracking down the error, as they'll have a complete
call stack to work with.

Tests: inspector/debugger/debugger-pause-on-blocked-event-handler.html
       inspector/debugger/debugger-pause-on-blocked-script-injection.html
       inspector/debugger/debugger-pause-on-blocked-script-url.html

* English.lproj/localizedStrings.js:
    Adding localizable string for the new friendly pause message.
* inspector/Inspector.json:
    Add CSPViolation as a recognized reason for pausing execution.
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::scriptExecutionBlockedByCSP):
    Teach the InspectorDebuggerAgent about script blocking. If pause on
    exceptions is enabled, call 'InspectorDebuggerAgent::breakProgram',
    and pass in an error object with a description that points to CSP
    as the culprit.
(WebCore):
* inspector/InspectorDebuggerAgent.h:
(InspectorDebuggerAgent):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::scriptExecutionBlockedByCSPImpl):
    Wire 'InspectorInstrumentation::scriptExecutionBlockedByCSP' to
    the InspectorDebuggerAgent backend.
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::scriptExecutionBlockedByCSP):
    The public interface that should be kicked whenever CSP blocks
    script execution.
(WebCore):
* inspector/front-end/DebuggerModel.js:
    Add CSPViolation as a recognized reason for pausing execution.
* inspector/front-end/ScriptsPanel.js:
    Add a friendly call stack status message for CSP violations.
* page/ContentSecurityPolicy.cpp:
(CSPDirectiveList):
(WebCore::CSPDirectiveList::checkNonceAndReportViolation):
    If script is blocked because the nonce doesn't match, report the
    blocked script to the inspector.
(WebCore::CSPDirectiveList::checkInlineAndReportViolation):
    If inline script is blocked, report the blocked script to the
    inspector. This requires adding a bool parameter to differentiate
    blocking inline script from inline style.
(WebCore::CSPDirectiveList::allowJavaScriptURLs):
    Tell 'checkInlineAndReportViolation' that we're dealing with script.
(WebCore::CSPDirectiveList::allowInlineEventHandlers):
    Tell 'checkInlineAndReportViolation' that we're dealing with script.
(WebCore::CSPDirectiveList::allowInlineScript):
    Tell 'checkInlineAndReportViolation' that we're dealing with script.
(WebCore::CSPDirectiveList::allowInlineStyle):
    Tell 'checkInlineAndReportViolation' that we're not dealing with script.
(WebCore::ContentSecurityPolicy::reportBlockedScriptExecutionToInspector):
    Public interface for the various CSP* classes to poke the inspector.
(WebCore):
* page/ContentSecurityPolicy.h:

LayoutTests: Break on inline scripts blocked by CSP.
https://bugs.webkit.org/show_bug.cgi?id=93865

Patch by Mike West <mkwst@chromium.org> on 2012-09-15
Reviewed by Pavel Feldman.

* inspector/debugger/debugger-pause-on-blocked-event-handler-expected.txt: Added.
* inspector/debugger/debugger-pause-on-blocked-event-handler.html: Added.
* inspector/debugger/debugger-pause-on-blocked-script-injection-expected.txt: Added.
* inspector/debugger/debugger-pause-on-blocked-script-injection.html: Added.
* inspector/debugger/debugger-pause-on-blocked-script-url-expected.txt: Added.
* inspector/debugger/debugger-pause-on-blocked-script-url.html: Added.
* inspector/debugger/resources/pause-on-blocked-by-csp.js: Added.
(test.setStatus):
(test.step1):
(test.step2):
(test):
* inspector/debugger/resources/pause-on-blocked-event-handler.js: Added.
(testAction):
* inspector/debugger/resources/pause-on-blocked-script-injection.js: Added.
(testAction):
* inspector/debugger/resources/pause-on-blocked-script-url.js: Added.
(testAction):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed JSLock to use the platform abstraction for Mutex instead of
depending on pthreads.
https://bugs.webkit.org/show_bug.cgi?id=96858.

Reviewed by Filip Pizlo.

This fixes a synchronization problem on the Windows port and makes
it more reliable when running the layout tests.

* runtime/InitializeThreading.cpp:
(JSC::initializeThreadingOnce):
* runtime/JSLock.cpp:
(JSC):
(JSC::GlobalJSLock::GlobalJSLock):
(JSC::GlobalJSLock::~GlobalJSLock):
(JSC::GlobalJSLock::initialize):
* runtime/JSLock.h:
(GlobalJSLock):
(JSLock):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128704 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Following the Butterfly refactoring, the comment for lastArraySize was not updated
https://bugs.webkit.org/show_bug.cgi?id=96877

Reviewed by Sam Weinig.

* runtime/JSObject.cpp:
(JSC):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSObject.cpp and JSArray.cpp have inconsistent tests for the invalid array index case
https://bugs.webkit.org/show_bug.cgi?id=96878

Reviewed by Sam Weinig.

Removed the uses of UNLIKELY() because I don't believe they are buying us anything,
since we're already on the slow path. Also found other places where we're testing for
the invalid array index case using unusual predicates rather than just using
MAX_ARRAY_INDEX. With this change, I believe that all of our tests for invalid
array indices (i.e. indices that should be treated as non-indexed properties)
uniformly use MAX_ARRAY_INDEX and PropertyName::NotAnIndex.

* runtime/JSArray.cpp:
(JSC::JSArray::push):
* runtime/JSObject.cpp:
(JSC::JSObject::putByIndex):
(JSC::JSObject::defineOwnIndexedProperty):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Skip fast/events/message-port-constructor-for-deleted-document.html
https://bugs.webkit.org/show_bug.cgi?id=96885

Unreviewed EFL gardening.

Causes assertion failure in MessagePort::contextDestroyed in
http/tests/security/MessagePort/event-listener-context.html, usually
attributed to later tests. We need to skip the test for now.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-16

* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] 3 spatial navigation tests can be unskipped after r128644
https://bugs.webkit.org/show_bug.cgi?id=96880

Unreviewed EFL gardening.

Unskip 3 spatial navigation tests that have been fixed in r128644.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-16

* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128708 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Mark inspector/debugger/dynamic-script-tag.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=96887

Unreviewed EFL gardening.

Mark inspector/debugger/dynamic-script-tag.html as flaky
in EFL's TestExpectations.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-16

* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Update TestExpectations for tests requiring plugins support
https://bugs.webkit.org/show_bug.cgi?id=96882

Unreviewed EFL gardening.

Regroup all test requiring plugins support in TestExpectation file
and update their bug number.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-16

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Skip fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html
https://bugs.webkit.org/show_bug.cgi?id=96884

Unreviewed EFL gardening.

Skip fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html
because EFL's DRT does not support overriding 'WebKitDisplayImagesKey'
preference yet.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-16

* platform/efl-wk1/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128711 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Missing dllexport causing linking errors on Windows platform
https://bugs.webkit.org/show_bug.cgi?id=96888

Patch by Kalev Lember <kalevlember@gmail.com> on 2012-09-16
Reviewed by Kentaro Hara.

Define BUILDING_WebCore during the build to properly mark
FrameDestructionObserver symbols with __declspec(dllexport) attribute.

* GNUmakefile.am:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r126763): css1/pseudo/firstline.html fails when using the complex text code path
https://bugs.webkit.org/show_bug.cgi?id=96890

Reviewed by Sam Weinig.

Source/WebCore: 

Test: fast/text/stale-TextLayout-from-first-line.html

When a first-line style specifies a font, different pieces of the same RednerText can be
laid out using different fonts, requiring a differet TextLayout for each piece.

* rendering/RenderBlock.h:
(RenderTextInfo): Added m_font data member.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::RenderTextInfo::RenderTextInfo): Added initializer for new data member.
(WebCore::RenderBlock::LineBreaker::nextLineBreak): Added code to update the text layout in
renderTextInfo if the font has changed.

LayoutTests: 

* fast/text/stale-TextLayout-from-first-line-expected.html: Added.
* fast/text/stale-TextLayout-from-first-line.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed a typo in the last entry noticed by Eric Seidel.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Rebaseline after r128691
https://bugs.webkit.org/show_bug.cgi?id=96892

Rebaseline fast/css/word-space-extra.html for chromium.

* platform/chromium-linux/fast/css/word-space-extra-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Chromium win build fix - listing a file that doesn't exist is a fatal errors in the msvs gyp generator.

* WebCore.gypi:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128716 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled DEPS.

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

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Mark inspector/elements/delete-from-document.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=96897

Unreviewed EFL gardening.

Mark inspector/elements/delete-from-document.html as flaky.
It sometimes times out of the WK2-EFL bot.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-16

* platform/efl-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Skip http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
https://bugs.webkit.org/show_bug.cgi?id=96895

Unreviewed EFL gardening.

Skip http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html for
EFL port since it sometimes asserts in MessagePort::contextDestroyed.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-16

* platform/efl/TestExpectations:

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