[CSS Shaders] Invalid shaders should act as pass-through filters
https://bugs.webkit.org/show_bug.cgi?id=93405

Reviewed by Dean Jackson.

Source/WebCore:

If the shader fails to apply then clearShaderResult will just copy the result of the previous filter
to the output of the current filter.

Test: css3/filters/custom/invalid-custom-filter-shader.html

* platform/graphics/filters/FECustomFilter.cpp:
(WebCore::FECustomFilter::platformApplySoftware):
(WebCore):
(WebCore::FECustomFilter::clearShaderResult):
(WebCore::FECustomFilter::applyShader):
* platform/graphics/filters/FECustomFilter.h:
(FECustomFilter):
* rendering/style/StyleCustomFilterProgram.h: The test was exposing the fact that if the shaders were referencing the same
file then StyleCustomFilterProgram will never complete the load. Having the same file for both the vertex and the fragment shader
cannot really work, because the shaders would not compile anyway, thus triggering an invalid shader.
I'm fixing it part of this change because the current test actually exposes that on Safari Mac builds. See the note in the LayoutTest/ChangeLog.
(WebCore::StyleCustomFilterProgram::notifyFinished):

LayoutTests:

Note that invalid-custom-filter-shader-expected.html is actually using another builtin filter,
just to make sure we trigger the whole FilterEffectRenderer on the images, otherwise the result will be
slightly different because of the conversion errors. Having another filter like grayscale(0) will trigger
the same precission errors on the result of the expected html.

* css3/filters/custom/invalid-custom-filter-shader-expected.html: Added.
* css3/filters/custom/invalid-custom-filter-shader.html: Added.
* css3/filters/resources/invalid-shader.vs: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Move scrollbar pointer into WebScrollbarThemePainter
https://bugs.webkit.org/show_bug.cgi?id=93541

Reviewed by James Robinson.

Source/Platform:

Update WebScrollbarThemePainter to encapsulate a pointer to the
scrollbar as well. Lion scrollbars and RenderScrollbars are both
incompatible with wrapping a scrollbar in a WebScrollbar.

ScrollbarTheme(Chromium)Mac attaches extra data to a scrollbar based
on the pointer value (via a static map keyed on the pointer) so
passing an object that returns all the same values for the
ScrollbarThemeClient interface but has a different pointer will fail
to paint.

RenderScrollbar does static casts on the ScrollbarThemeClient pointer
that it is passed, assuming that it is the same. Therefore, it also
cannot use a WebScrollbar.

To fix this, push the real scrollbar pointer into the painter.

* chromium/public/WebScrollbarThemePainter.h:
(WebCore):
(WebKit::WebScrollbarThemePainter::WebScrollbarThemePainter):
(WebScrollbarThemePainter):

Source/WebCore:

Update clients of WebScrollbarThemePainter.

* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
(WebCore::createScrollbarLayer):
* platform/graphics/chromium/ScrollbarLayerChromium.cpp:

Source/WebKit/chromium:

Fix WebScrollbarThemePainter implementation to make direct calls on
the scrollbar rather than through the WebScrollbarThemeClientImpl
adapter.

* src/WebScrollbarThemePainter.cpp:
(WebKit::WebScrollbarThemePainter::assign):
(WebKit::WebScrollbarThemePainter::paintScrollbarBackground):
(WebKit::WebScrollbarThemePainter::paintTrackBackground):
(WebKit::WebScrollbarThemePainter::paintBackTrackPart):
(WebKit::WebScrollbarThemePainter::paintForwardTrackPart):
(WebKit::WebScrollbarThemePainter::paintBackButtonStart):
(WebKit::WebScrollbarThemePainter::paintBackButtonEnd):
(WebKit::WebScrollbarThemePainter::paintForwardButtonStart):
(WebKit::WebScrollbarThemePainter::paintForwardButtonEnd):
(WebKit::WebScrollbarThemePainter::paintTickmarks):
(WebKit::WebScrollbarThemePainter::paintThumb):
(WebKit::WebScrollbarThemePainter::WebScrollbarThemePainter):
* tests/ScrollbarLayerChromiumTest.cpp:
(WebCore::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
nrwt: rename finder.py to layout_test_finder.py
https://bugs.webkit.org/show_bug.cgi?id=93557

Reviewed by Ryosuke Niwa.

One last cleanup per old review feedback from rniwa.

* Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py: Renamed from Tools/Scripts/webkitpy/layout_tests/controllers/finder.py.
(LayoutTestFinder):
(LayoutTestFinder.__init__):
(LayoutTestFinder.find_tests):
(LayoutTestFinder._strip_test_dir_prefixes):
(LayoutTestFinder._strip_test_dir_prefix):
(LayoutTestFinder._read_test_names_from_file):
(LayoutTestFinder._strip_comments):
(LayoutTestFinder.skip_tests):
(LayoutTestFinder.split_into_chunks):
* Scripts/webkitpy/layout_tests/controllers/manager.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
writeHelperGetString in V8HTMLDocument uses += to concatenate strings
https://bugs.webkit.org/show_bug.cgi?id=93035

Patch by Jae Hyun Park <jae.park@company100.net> on 2012-08-08
Reviewed by Adam Barth.

Use a StringBuilder instead of String concatenation because StringBuilder is generally faster.

No new functionality, so no new tests.

* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::writeHelperGetString):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
EventDispatcher::dispatchSimulatedClick should not reuse the same EventDispatcher instance.
https://bugs.webkit.org/show_bug.cgi?id=93452

Reviewed by Dimitri Glazkov.

This is a follow up patch after r124975.  There is yet another
place where the same EventDispatcher instance is reused across
event dispatching.

In addition to that, in order to simulate a real click, we must
different dispatchers because we must recalculate event ancestors
each time.  Current implementation wrongly freezes event ancestors
at the first event dispatching.

No new tests, no change in functionality.

* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchSimulatedClick):
(WebCore::EventDispatcher::EventDispatcher):
(WebCore::EventDispatcher::dispatchEvent):
* dom/EventDispatcher.h:
(EventDispatcher):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125133 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use char* instead of LChar* for the public interface of String construction from literals
https://bugs.webkit.org/show_bug.cgi?id=93402

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-08-08
Reviewed by Michael Saboff.

Source/JavaScriptCore: 

Update JSC' Identifier to use StringImpl::createFromLiteral with a char*.

* runtime/Identifier.cpp:
(JSC::IdentifierASCIIStringTranslator::translate):

Source/WTF: 

When the initialization from literal was added, some constructor/initialization function were
using LChar for convenience.

Since those function should only take ASCII characters, using LChar* could cause confusion. This
patch intents to clarify this by using char* for all those APIs.

* wtf/text/AtomicString.cpp:
(WTF::CharBufferFromLiteralDataTranslator::hash):
(WTF::CharBufferFromLiteralDataTranslator::equal):
(WTF::CharBufferFromLiteralDataTranslator::translate):
(WTF::AtomicString::addFromLiteralData):
* wtf/text/AtomicString.h:
(WTF::AtomicString::AtomicString):
(AtomicString):
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::createFromLiteral):
* wtf/text/StringImpl.h:
(StringImpl):
(WTF::StringImpl::StringImpl):
(WTF::StringImpl::createFromLiteral):

Tools: 

* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix invalid test
https://bugs.webkit.org/show_bug.cgi?id=93543

Reviewed by Kentaro Hara.

The HTMLMediaElement.prototype.NETWORK_NO_SOURCE is non writable so assigning to the element instance should
be ignored.

* media/network-no-source-const-shadow-expected.txt:
* media/network-no-source-const-shadow.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed TestExpectations cleanup and a new baseline.

* platform/chromium/TestExpectations:
* platform/chromium/http/tests/security/sandboxed-iframe-modify-self-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
css3/flexbox/content-height-with-scrollbars.html failing on non-fractional pixel layout machines
https://bugs.webkit.org/show_bug.cgi?id=93530

Unreviewed, fixing the test to not depend on rounding behavior.

* css3/flexbox/content-height-with-scrollbars-expected.html: Use a fixed width.
* css3/flexbox/content-height-with-scrollbars.html: Use a fixed width.
* platform/efl/TestExpectations: Remove failing expectation.
* platform/gtk/TestExpectations: Remove failing expectation.
* platform/mac/TestExpectations: Remove failing expectation.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium-mac] Switch to LocalizedNumberMac from LocalizedNumberICU
https://bugs.webkit.org/show_bug.cgi?id=93432

Reviewed by Hajime Morita.

Source/WebCore:

No new tests. Covered by fast/forms/number/number-lossless-localization.html,
and WebKit/chromium/tests/LocaleMacTest.cpp.

* WebCore.gyp/WebCore.gyp:
Exclude locale-relatef files for ICU, and include files for Mac.

Source/WebKit/chromium:

* tests/LocaleMacTest.cpp:
Add some tests for number localization. They are similar to tests in
LocaleWinTest and LocalizedNumberICUTest.cpp
(LocaleMacTest):
(LocaleMacTest::decimalSeparator):
(TEST_F):
(testNumberIsReversible):
(testNumbers):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Compile flag for CSS Hierarchies
https://bugs.webkit.org/show_bug.cgi?id=92433

Patch by Shane Stephens <shanestephens@google.com> on 2012-08-08
Reviewed by Tony Chang.

.:

* Source/cmake/WebKitFeatures.cmake:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Note that this flag is disabled on all platforms for now.

No new tests since there's no functional change.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/chromium:

* features.gypi:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* Scripts/webkitperl/FeatureList.pm:
* qmake/mkspecs/features/features.pri:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Extract the definition of NativeImagePtr from ImageSource.h into NativeImagePtr.h.
https://bugs.webkit.org/show_bug.cgi?id=93466

Patch by Huang Dongsung <luxtella@company100.net> on 2012-08-08
Reviewed by Adam Barth.

Image.h includes ImageSource.h in order to know the definition of NativeImagePtr.
But Image does not need to know the definition of ImageSource. So, this patch
extracts the definition of NativeImagePtr from ImageSource.h into NativeImagePtr.h.

This is a preparation for asynchronous image decoding. Async decoding
will need a callback function, which sends a NativeImagePtr to clients, and the
callback must know the definition of NativeImagePtr, not ImageSource.

No new tests, behavior is unchanged.

* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
* platform/graphics/ImageSource.h:
(WebCore):
* platform/graphics/NativeImagePtr.h: Added.
(WebCore):

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

Doesn't compile on Mac (Requested by tony^work on #webkit).

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

* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
* platform/graphics/ImageSource.h:
(WebCore):
* platform/graphics/NativeImagePtr.h: Removed.
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement JSDOMWindow*::allowsAccessFrom* in terms of BindingSecurity
https://bugs.webkit.org/show_bug.cgi?id=93407

Reviewed by Eric Seidel.

This patch removes allowsAccessFrom and implements the security checks
in terms of shouldAllowAccessToFrame directly. There shouldn't be any
change in behavior.

* bindings/js/JSDOMWindowBase.cpp:
(WebCore):
(WebCore::shouldAllowAccessFrom):
* bindings/js/JSDOMWindowBase.h:
(JSDOMWindowBase):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::namedItemGetter):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertyDescriptor):
(WebCore::JSDOMWindow::put):
(WebCore::JSDOMWindow::deleteProperty):
(WebCore::JSDOMWindow::getPropertyNames):
(WebCore::JSDOMWindow::getOwnPropertyNames):
(WebCore::JSDOMWindow::defineOwnProperty):
(WebCore::JSDOMWindow::setLocation):
* bindings/js/JSDOMWindowCustom.h:
* bindings/js/JSInjectedScriptManager.cpp:
(WebCore::InjectedScriptManager::canAccessInspectedWindow):
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject _isSafeScript]):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertyDescriptorBody):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectExcitingAttr):
(WebCore::jsTestActiveDOMObjectConstructor):
(WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[SVG] load events shouldn't be fired during Node::insrtedInto()
https://bugs.webkit.org/show_bug.cgi?id=92969

Reviewed by Ryosuke Niwa.

Source/WebCore:

Event dispatches during insertedInto() allow event handlers to
break DOM tree cosistency. This chagne makes them async for load
events which are dispatched during insertedInto() call. This
prevents event handlers from breaking tree consistency while the
notification traversal.

Test: svg/custom/loadevents-async.html

* svg/SVGElement.cpp:
(WebCore::SVGElement::sendSVGLoadEventIfPossibleAsynchronously): Added.
(WebCore):
(WebCore::SVGElement::svgLoadEventTimerFired): Added.
(WebCore::SVGElement::svgLoadEventTimer):
- Added a stub. Implemented in SVGScriptElement, SVGStopElement, SVGUseElement
  where the load event happens.
* svg/SVGElement.h:
(SVGElement):
* svg/SVGExternalResourcesRequired.cpp:
(WebCore::SVGExternalResourcesRequired::insertedIntoDocument):
- Replaces event dispatch call with async version.
* svg/SVGScriptElement.h:
* svg/SVGStyleElement.h:
* svg/SVGUseElement.h:

LayoutTests:

* svg/custom/loadevents-async-expected.txt: Added.
* svg/custom/loadevents-async.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
nested fragment parser test slow on Android
https://bugs.webkit.org/show_bug.cgi?id=90438

Patch by Wei James <james.wei@intel.com> on 2012-08-08
Reviewed by Ryosuke Niwa.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unprefix window.webkitURL
https://bugs.webkit.org/show_bug.cgi?id=93034

Reviewed by Jian Li.

Adding unprefixed window.URL as other browsers like FireFox and Opera 12 seem to have the API unprefixed.
(This patch doesn't remove webkitURL yet as Safari and Chrome has exposed the URL for a while now.)

Source/WebCore:

Test: fast/dom/DOMURL/check-instanceof-domurl-functions.html

* page/DOMWindow.cpp:
* page/DOMWindow.h:
(DOMWindow):
* page/DOMWindow.idl:
* workers/WorkerContext.idl:

LayoutTests:

Changed most of the window.URL test code to use unprefixed version.
To verify webkitURL is still available left webkitURL related tests in
fast/dom/DOMURL/check-instanceof-domurl-functions.html.

* editing/pasteboard/data-transfer-items-image-png.html:
* fast/dom/DOMURL/check-instanceof-domurl-functions-expected.txt:
* fast/dom/DOMURL/check-instanceof-domurl-functions.html:
* fast/dom/HTMLAnchorElement/anchor-download-unset.html:
* fast/dom/HTMLAnchorElement/anchor-download.html:
* fast/dom/HTMLAnchorElement/anchor-nodownload-set.html:
* fast/dom/HTMLAnchorElement/anchor-nodownload.html:
* fast/dom/constructed-objects-prototypes-expected.txt:
* fast/dom/window-domurl-crash.html:
* fast/files/apply-blob-url-to-img.html:
* fast/files/apply-blob-url-to-xhr.html:
* fast/files/create-blob-url-crash.html:
* fast/files/domurl-script-execution-context-crash.html:
* fast/files/revoke-blob-url.html:
* fast/files/url-null-expected.txt:
* fast/files/url-null.html:
* fast/files/url-required-arguments-expected.txt:
* fast/files/url-required-arguments.html:
* fast/files/workers/inline-worker-via-blob-url.html:
* fast/files/workers/resources/worker-apply-blob-url-to-xhr.js:
* fast/js/constructor-length.html:
* http/tests/fileapi/create-blob-url-from-data-url.html:
* http/tests/security/mixedContent/blob-url-in-iframe.html:
* platform/chromium-win/compositing/geometry/object-clip-rects-assertion-expected.txt:
* platform/chromium/fast/files/url-required-arguments-expected.txt:
* platform/chromium/media/video-capture-preview.html:
* platform/gtk/fast/dom/constructed-objects-prototypes-expected.txt:
* platform/gtk/fast/files/url-required-arguments-expected.txt:
* platform/gtk/fast/js/constructor-length-expected.txt:
* platform/gtk/fast/js/global-constructors-expected.txt:
* platform/mac/fast/js/constructor-length-expected.txt:
* platform/mac/fast/js/global-constructors-expected.txt:
* platform/qt-5.0/fast/js/global-constructors-expected.txt:
* platform/qt/fast/dom/constructed-objects-prototypes-expected.txt:
* platform/qt/fast/js/constructor-length-expected.txt:
* platform/qt/fast/js/global-constructors-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skip platform/mac/editing/deleting/backward-delete.html on android
https://bugs.webkit.org/show_bug.cgi?id=90585

Patch by Xingnan Wang <xingnan.wang@intel.com> on 2012-08-08
Reviewed by Adam Barth.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skip CoreAnimation plugin model tests on android
https://bugs.webkit.org/show_bug.cgi?id=90586

Patch by Xingnan Wang <xingnan.wang@intel.com> on 2012-08-08
Reviewed by Adam Barth.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r125146.
http://trac.webkit.org/changeset/125146
https://bugs.webkit.org/show_bug.cgi?id=93578

Would like to study fast/dom/Window/timer-null-script-
execution-context.html behavior change (Requested by abarth on
#webkit).

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

* bindings/js/JSDOMWindowBase.cpp:
(WebCore):
(WebCore::JSDOMWindowBase::crossDomainAccessErrorMessage):
(WebCore::JSDOMWindowBase::allowsAccessFrom):
* bindings/js/JSDOMWindowBase.h:
(JSDOMWindowBase):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::namedItemGetter):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertyDescriptor):
(WebCore::JSDOMWindow::put):
(WebCore::JSDOMWindow::deleteProperty):
(WebCore::JSDOMWindow::getPropertyNames):
(WebCore::JSDOMWindow::getOwnPropertyNames):
(WebCore::JSDOMWindow::defineOwnProperty):
(WebCore::JSDOMWindow::setLocation):
* bindings/js/JSDOMWindowCustom.h:
(WebCore::JSDOMWindowBase::allowsAccessFrom):
(WebCore):
(WebCore::JSDOMWindowBase::allowsAccessFromNoErrorMessage):
(WebCore::JSDOMWindowBase::allowsAccessFromPrivate):
* bindings/js/JSInjectedScriptManager.cpp:
(WebCore::InjectedScriptManager::canAccessInspectedWindow):
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject _isSafeScript]):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertyDescriptorBody):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectExcitingAttr):
(WebCore::jsTestActiveDOMObjectConstructor):
(WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):

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