[WK2][WKTR] TestRunner needs to implement dumpApplicationCacheDelegateCallbacks
https://bugs.webkit.org/show_bug.cgi?id=96374

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-12
Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

Add Bundle C API to reset the application cache quota
for a given origin.

Add new reachedApplicationCacheOriginQuota callback
to WKBundlePageUIClient which is called from
WebChromeClient::reachedApplicationCacheOriginQuota().

Those are needed by WebKitTestRunner to dump
information about the application cache callbacks
if instructed to.

* Shared/APIClientTraits.cpp:
(WebKit):
* Shared/APIClientTraits.h:
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetApplicationCacheOriginQuota):
(WKBundleResetApplicationCacheOriginQuota):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::resetApplicationCacheOriginQuota):
(WebKit):
* WebProcess/InjectedBundle/InjectedBundle.h:
(InjectedBundle):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::didReachApplicationCacheOriginQuota):
(WebKit):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
(WebKit):
(InjectedBundlePageUIClient):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
* win/WebKit2.def:
* win/WebKit2CFLite.def:

Tools:

Implement support for dumpApplicationCacheDelegateCallbacks
and disallowIncreaseForApplicationCacheQuota in
WebKitTestRunner and properly dump the information
expected by the tests.

If the application cache quota is reached for a given
security origin, WebKitTestRunner will reset the quota
to its default value, unless intructed not to via
disallowIncreaseForApplicationCacheQuota().

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::InjectedBundlePage::didReachApplicationCacheOriginQuota):
(WTR):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
(InjectedBundlePage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::TestRunner):
(WTR::TestRunner::disallowIncreaseForApplicationCacheQuota):
(WTR):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::dumpApplicationCacheDelegateCallbacks):
(TestRunner):
(WTR::TestRunner::shouldDisallowIncreaseForApplicationCacheQuota):
(WTR::TestRunner::shouldDumpApplicationCacheDelegateCallbacks):

LayoutTests:

Unskip test cases that are passing now that WebKitTestRunner
implements dumpApplicationCacheDelegateCallbacks and
disallowIncreaseForApplicationCacheQuota.

* platform/efl-wk1/TestExpectations:
* platform/efl/Skipped:
* platform/wk2/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] [WK2] Memory leaks in TestControllerEfl
https://bugs.webkit.org/show_bug.cgi?id=96525

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-09-12
Reviewed by Kenneth Rohde Christiansen.

Fix memory leaks in EFL's TestRunner code by adopting an allocation
of WKString created with WKStringCreateWithUTF8CString().

* WebKitTestRunner/efl/TestControllerEfl.cpp:
(WTR::TestController::initializeInjectedBundlePath):
(WTR::TestController::initializeTestPluginDirectory):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed trivial build fix for Qt/Windows

As pointed out by Kevin, we should inject the "set PATH=..." statement
to add the GnuWin32 directory only if that directory actually exists.

* qmake/mkspecs/features/default_post.prf:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove transient state regarding uknown pseudoelements from SelectorChecker.
https://bugs.webkit.org/show_bug.cgi?id=96425

Reviewed by Eric Seidel.

The fact that an unknown pseudoelement was found when checking selector was stored as extra state on SelectorChecker. That's bad,
because this state is at odds with the lifecycle of the instance and had to be explicitly reset prior to each checking. To address
this, I made checkSelector report the value as its result (by-ref parameter, actually).

No new tests, refactoring only. Covered by existing tests.

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::SelectorChecker): Removed the now-unneded state initialization.
(WebCore::SelectorChecker::checkSelector): Changed to take extra parameter.
(WebCore):
(WebCore::SelectorChecker::checkOneSelector): Ditto.
* css/SelectorChecker.h:
(SelectorChecker): Changed decls accordingly.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver): Added state to StyleResolver.
(WebCore::StyleResolver::collectMatchingRulesForList): Changed to use own state, rather than StyleChecker's state.
* css/StyleResolver.h:
(StyleResolver): Moved state here from StyleChecker.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Scoped Style] NodeRareData::m_numberOfScopedHTMLStyleChildren could be replaced with a node flag.
https://bugs.webkit.org/show_bug.cgi?id=96450

Reviewed by Dimitri Glazkov.

This change gets rid of NodeRareData::m_numberOfScopedHTMLStyleChildren
by replacing it with a Node flag called HasScopedHTMLStyleChildFlag.
Instead of tracking the number of certain node, this chagne compute the number
when necessary.

Now we no longer need to hit rareData() for each hasScopedHTMLStyleChild() call.
Note that because such a re-counting occurs only when the scoped <style> elements
leave the tree, the performance impact is negligible.

No new tests. Covered by existing tests.

* dom/Node.cpp:
(WebCore):
* dom/Node.h:
(WebCore::Node::hasScopedHTMLStyleChild):
(WebCore::Node::setHasScopedHTMLStyleChild):
(Node):
* dom/NodeRareData.h:
(WebCore::NodeRareData::NodeRareData):
(NodeRareData):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::isRegisteredAsScoped):
(WebCore):
(WebCore::Node::registerScopedHTMLStyleChild):
(WebCore::Node::unregisterScopedHTMLStyleChild):
(WebCore::Node::numberOfScopedHTMLStyleChildren):
(WebCore::HTMLStyleElement::unregisterWithScopingNode):
* html/HTMLStyleElement.h:
(HTMLStyleElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Assert hit in is multiSelectable()
https://bugs.webkit.org/show_bug.cgi?id=96530

Reviewed by Chris Fleizach.

Fix crash if element isn't a select element.

This bug slipped through in a refactoring change (bug 96323).
Covered by existing tests.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isMultiSelectable):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128332 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix Qt/Windows build with Python3
https://bugs.webkit.org/show_bug.cgi?id=96473

Patch by Simon Hausmann <simon.hausmann@nokia.com> on 2012-09-12
Reviewed by Csaba Osztrogonác.

In Python 3 print is a real function, so we must use parentheses around
the function parameters. This is backwards compatible with Python 2.

* Scripts/generate-win32-export-forwards:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shaders] Remove direct texture access via u_texture
https://bugs.webkit.org/show_bug.cgi?id=93871

Patch by Max Vujovic <mvujovic@adobe.com> on 2012-09-12
Reviewed by Dean Jackson.

Source/WebCore:

Remove the author-accessible "u_texture" sampler, which referenced the DOM element texture.

Additionally, reject shaders with author-defined sampler uniforms. When we implement texture
parameters, we will allow shaders whose samplers are bound to valid textures. We must not
allow OpenGL to give unbound samplers a default value of 0 because that references the DOM
element texture, which should be inaccessible to the author's shader code.

Test: css3/filters/custom/custom-filter-no-element-texture-access.html

* platform/graphics/ANGLEWebKitBridge.cpp:
(WebCore::getValidationResultValue):
    Add a file-static function to easily query the integer values that ANGLE exposes about
    the last validation result. The new getUniforms method and the existing
    validateShaderSource method now both use getValidationResultValue.
(WebCore):
(WebCore::ANGLEWebKitBridge::validateShaderSource):
    Use the new getValidationResultValue function instead of ANGLE's ShGetInfo function.
(WebCore::ANGLEWebKitBridge::getUniforms):
    Add a new public method to ANGLEWebKitBridge which gets the info about all of the
    uniforms in the last validated vertex shader or fragment shader. Uniform info includes
    name, type, and size.
* platform/graphics/ANGLEWebKitBridge.h:
(ANGLEShaderSymbol):
(WebCore::ANGLEShaderSymbol::isSampler):
    Returns true if the symbol's data type is a GLSL sampler (e.g. sampler2D, samplerCube).
(WebCore):
(ANGLEWebKitBridge):
* platform/graphics/filters/CustomFilterCompiledProgram.cpp:
(WebCore::CustomFilterCompiledProgram::CustomFilterCompiledProgram):
    Take in an additional programType constructor parameter.
(WebCore::CustomFilterCompiledProgram::initializeParameterLocations):
    Remove the author-accessible DOM element texture sampler "u_texture". Only find the
    location of the internal DOM element texture sampler "css_u_texture" if the author is
    using the CSS mix function.
* platform/graphics/filters/CustomFilterCompiledProgram.h:
* platform/graphics/filters/CustomFilterProgramInfo.h:
(CustomFilterProgramInfo):
(WebCore::CustomFilterProgramInfo::programType):
    Add the new CustomFilterProgramType enum. In CustomFilterProgramInfo, we plan to replace
    mixSettings.enabled with a programType. See:
    https://bugs.webkit.org/show_bug.cgi?id=96448
* platform/graphics/filters/CustomFilterValidatedProgram.cpp:
    Reject all shaders that have sampler uniforms defined.
(WebCore::CustomFilterValidatedProgram::CustomFilterValidatedProgram):
(WebCore::CustomFilterValidatedProgram::compiledProgram):
* platform/graphics/filters/FECustomFilter.cpp:
(WebCore::FECustomFilter::bindProgramAndBuffers):
    Add an assert to verify that the DOM element texture is bound only if the author is
    using the CSS mix function.

LayoutTests:

Add tests to verify that the "u_texture" sampler is no longer accessible to author shader
code because it was removed. These tests also verify that shaders with unbound samplers do
not execute.

Add tests to verify that the internal "css_u_texture" sampler is not accessible to author
shader code. These tests check that this is true whether or not the author is using the CSS
mix function and whether or not the author attempts to define css_u_texture is his or her
shader.

* css3/filters/custom/custom-filter-no-element-texture-access-expected.html: Added.
* css3/filters/custom/custom-filter-no-element-texture-access.html: Added.
* css3/filters/resources/sample-defined-css-u-texture-mix.fs: Added.
* css3/filters/resources/sample-defined-css-u-texture.fs: Added.
* css3/filters/resources/sample-u-texture-mix.fs: Added.
* css3/filters/resources/sample-u-texture.fs: Added.
* css3/filters/resources/sample-undefined-css-u-texture-mix.fs: Added.
* css3/filters/resources/sample-undefined-css-u-texture.fs: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions]Shrink RenderFlowThread size by using bit flags
https://bugs.webkit.org/show_bug.cgi?id=96503

Reviewed by Andreas Kling.

Use bit fields instead of full bool.

No new functionality, just refactoring. Functionality covered by existing tests in fast/regions.

* rendering/RenderFlowThread.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Exclusions] Test incremental layout
https://bugs.webkit.org/show_bug.cgi?id=91879

Patch by Bear Travis <betravis@adobe.com> on 2012-09-12
Reviewed by Julien Chaffraix.

Adding tests to make sure that text and shape can be set dynamically, and that
content will still layout while respecting shape-inside.

* fast/exclusions/shape-inside/shape-inside-dynamic-shape-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-dynamic-shape.html: Added.
* fast/exclusions/shape-inside/shape-inside-dynamic-text-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-dynamic-text.html: Added.

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