Prevent workers from calling back into other worlds
https://bugs.webkit.org/show_bug.cgi?id=96790

Patch by Dan Carney <dcarney@google.com> on 2012-09-14
Reviewed by Adam Barth.

Added a few sanity checks to ensure callbacks are always using the correct world.

No new tests. No new change in functionality.

* bindings/v8/V8DOMWrapper.cpp:
(WebCore::V8DOMWrapper::getEventListener):
* bindings/v8/V8LazyEventListener.cpp:
(WebCore::V8LazyEventListener::prepareListenerObject):
* bindings/v8/WorldContextHandle.cpp:
(WebCore::WorldContextHandle::WorldContextHandle):
(WebCore::WorldContextHandle::adjustedContext):
* bindings/v8/WorldContextHandle.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128651 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=96688
Put position:fixed elements in their own layers and allow them to 
create a stacking context
-and corresponding-
<rdar://problem/11467961>

Reviewed by Simon Fraser.

Source/WebKit/mac: 

Enable these settings in WK1 too for consistency. 
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2: 

Soon we want pages with fixed positioned elements to be able to be 
scrolled by the ScrollingCoordinator. As a part of that work, we have 
to composite fixed position elements, and we have to allow those
elements to create a stacking context.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):

LayoutTests: 

A few test result differences. These first three tests actually
render differently now.
* platform/mac/fast/block/positioning/016-expected.png:
* platform/mac/fast/block/positioning/016-expected.txt:
* platform/mac/fast/block/positioning/025-expected.png:
* platform/mac/fast/block/positioning/025-expected.txt:
* platform/mac/fast/block/positioning/fixed-position-stacking-context-expected.png: Added.
* platform/mac/fast/block/positioning/fixed-position-stacking-context-expected.txt: Added.

These tests just have different layer trees. 
* platform/mac/compositing/geometry/fixed-position-composited-switch-expected.txt: Added.
* platform/mac/compositing/rtl: Added.
* platform/mac/compositing/rtl/rtl-fixed-expected.txt: Added.
* platform/mac/compositing/rtl/rtl-fixed-overflow-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow third-party storage blocking setting to change while a page is loaded
https://bugs.webkit.org/show_bug.cgi?id=95790

Reviewed by Brady Eidson.

.:

Update exported symbols.

* Source/autotools/symbols.filter:

Source/WebCore:

Pipe through changes to the storage blocking policy to each document and plugin.

Tests: http/tests/security/storage-blocking-loosened-local-storage.html
       http/tests/security/storage-blocking-loosened-plugin.html
       http/tests/security/storage-blocking-loosened-private-browsing-plugin.html
       http/tests/security/storage-blocking-loosened-shared-worker.html
       http/tests/security/storage-blocking-loosened-websql.html
       http/tests/security/storage-blocking-strengthened-local-storage.html
       http/tests/security/storage-blocking-strengthened-plugin.html
       http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html
       http/tests/security/storage-blocking-strengthened-shared-worker.html
       http/tests/security/storage-blocking-strengthened-websql.html

* WebCore.exp.in:
* dom/Document.cpp: Pipe changes through to the Document's SecurityOrigin.
(WebCore::Document::storageBlockingStateDidChange):
(WebCore):
* dom/Document.h:
(Document):
* page/DOMWindow.cpp: Check to make sure access is allowed before returning a cached storage area.
(WebCore::DOMWindow::sessionStorage):
(WebCore::DOMWindow::localStorage):
* page/Page.cpp:
(WebCore::Page::collectPluginViews): Refactored out into a function.
(WebCore):
(WebCore::Page::storageBlockingStateChanged): Pipe changes through to each PluginView.
(WebCore::Page::privateBrowsingStateChanged):
* page/Page.h:
(Page):
* page/Settings.cpp:
(WebCore::Settings::setStorageBlockingPolicy): Tell Pages about changes to the storage blocking policy.
(WebCore):
* page/Settings.h:
(Settings):
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::storageBlockingStateChanged):

Source/WebKit2:

Inform plugins about changes to the storage blocking policy by way of the private browsing feature.

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::storageBlockingStateChanged):
(WebKit):
* PluginProcess/PluginControllerProxy.h:
(PluginControllerProxy):
* PluginProcess/PluginControllerProxy.messages.in: Add WK2 message for storageBlockingStateChanged.
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::storageBlockingStateChanged):
(WebKit):
(WebKit::NetscapePlugin::privateBrowsingStateChanged):
(WebKit::NetscapePlugin::updateNPNPrivateMode): Set plugin's private browsing if either private browsing or storage blocking is enabled.
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
(NetscapePlugin):
* WebProcess/Plugins/PDF/BuiltInPDFView.h:
(BuiltInPDFView):
* WebProcess/Plugins/PDF/BuiltInPDFView.mm: Treat storageBlockingStateChanged as a no-op.
(WebKit::BuiltInPDFView::storageBlockingStateChanged):
(WebKit):
* WebProcess/Plugins/Plugin.h: Add pure virtual storageBlockingStateChanged method.
(Plugin):
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::storageBlockingStateChanged):
(WebKit):
* WebProcess/Plugins/PluginProxy.h:
(PluginProxy):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::storageBlockingStateChanged):
(WebKit):
* WebProcess/Plugins/PluginView.h:
(PluginView):
* win/WebKit2.def:

LayoutTests:

Tested combinations of loosening and strengthening the storage blocking policy on various types of storage.

* http/tests/security/resources/iframe-for-storage-blocking-changed-local-storage.html: Added.
* http/tests/security/resources/iframe-for-storage-blocking-changed-shared-worker.html: Added.
* http/tests/security/resources/iframe-for-storage-blocking-changed-websql.html: Added.
* http/tests/security/storage-blocking-loosened-local-storage-expected.txt: Added.
* http/tests/security/storage-blocking-loosened-local-storage.html: Added.
* http/tests/security/storage-blocking-loosened-plugin-expected.txt: Added.
* http/tests/security/storage-blocking-loosened-plugin.html: Added.
* http/tests/security/storage-blocking-loosened-private-browsing-plugin-expected.txt: Added.
* http/tests/security/storage-blocking-loosened-private-browsing-plugin.html: Added.
* http/tests/security/storage-blocking-loosened-shared-worker-expected.txt: Added.
* http/tests/security/storage-blocking-loosened-shared-worker.html: Added.
* http/tests/security/storage-blocking-loosened-websql-expected.txt: Added.
* http/tests/security/storage-blocking-loosened-websql.html: Added.
* http/tests/security/storage-blocking-strengthened-local-storage-expected.txt: Added.
* http/tests/security/storage-blocking-strengthened-local-storage.html: Added.
* http/tests/security/storage-blocking-strengthened-plugin-expected.txt: Added.
* http/tests/security/storage-blocking-strengthened-plugin.html: Added.
* http/tests/security/storage-blocking-strengthened-private-browsing-plugin-expected.txt: Added.
* http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html: Added.
* http/tests/security/storage-blocking-strengthened-shared-worker-expected.txt: Added.
* http/tests/security/storage-blocking-strengthened-shared-worker.html: Added.
* http/tests/security/storage-blocking-strengthened-websql-expected.txt: Added.
* http/tests/security/storage-blocking-strengthened-websql.html: Added.
* platform/chromium/TestExpectations: Skip shared worker and plugin tests.
* platform/mac-wk2/http/tests/security/storage-blocking-strengthened-plugin-expected.txt: Added.
* platform/mac-wk2/http/tests/security/storage-blocking-strengthened-private-browsing-plugin-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ImageLoader can't be cleared when video element poster attribute removed.
https://bugs.webkit.org/show_bug.cgi?id=96301

Reviewed by Abhishek Arya.

Source/WebCore:

Same problem as in https://bugs.webkit.org/show_bug.cgi?id=90801. We can't
clear the image loader when the src attribute is cleared, because we might be
inside a handler called on top of an image loader event dispatch. Instead we
will rely on the OwnPtr relationship between the Element and the Image Loader
to limit the lifetime of the loader to that of the element.

Test: fast/dom/beforeload/clear-video-poster-in-beforeload-listener.html

* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::parseAttribute):
Remove permature clearing of m_imageLoader.
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::parseAttribute):
Remove permature clearing of m_imageLoader.
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseAttribute):
Remove permature clearing of m_imageLoader.

LayoutTests:

Added test case.

* fast/dom/beforeload/clear-video-poster-in-beforeload-listener-expected.txt: Added.
* fast/dom/beforeload/clear-video-poster-in-beforeload-listener.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support constructor-type attribute in idls other than DOMWindow.
https://bugs.webkit.org/show_bug.cgi?id=96821

Patch by Chang Shu <cshu@webkit.org> on 2012-09-14
Reviewed by Kentaro Hara.

In CodeGeneratorJS.pm, we should not assume only DOMWindow uses Constructor
attribute. So for other interfaces, we should pass castedThis->globalObject()
instead of castedThis.

Test: bindings/scripts/test/JS/JSTestObj.idl

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjConstructorTestSubObj):
(WebCore::jsTestObjConditionalAttr4Constructor):
(WebCore::jsTestObjConditionalAttr5Constructor):
(WebCore::jsTestObjConditionalAttr6Constructor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: transition doesn’t always override transition-property
https://bugs.webkit.org/show_bug.cgi?id=96658

Reviewed by Dean Jackson.

Source/WebCore:

Setting the animation property on an Animation in CSSToStyleMap::mapAnimationProperty()
is special because we have to call setAnimationMode(Animation::AnimateAll) as well
as setting the property to CSSPropertyInvalid if it's for the initial state
of the transition-property property.

In order to fix this via StyleBuilder PropertyHandlers, we have to know,
in ApplyPropertyAnimation::applyInitialValue(), which property is getting applied.
This requires passing the CSSPropertyID down through all of the "apply" methods.

Do some unrelated cleanup in CSSParser::parseTransitionShorthand(); the existing code
was not safe with respect to adding new properties to the shorthand.

Test: transitions/longhand-vs-shorthand-initial.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseTransitionShorthand):
* css/StyleBuilder.cpp:
(WebCore::ApplyPropertyExpanding::applyInheritValue):
(WebCore::ApplyPropertyExpanding::applyInitialValue):
(WebCore::ApplyPropertyExpanding::applyValue):
(WebCore::ApplyPropertyDefaultBase::applyInheritValue):
(WebCore::ApplyPropertyDefaultBase::applyInitialValue):
(WebCore::ApplyPropertyDefaultBase::applyValue):
(WebCore::ApplyPropertyDefault::applyValue):
(WebCore::ApplyPropertyNumber::applyValue):
(WebCore::ApplyPropertyStyleImage::applyValue):
(WebCore::ApplyPropertyAuto::applyInheritValue):
(WebCore::ApplyPropertyAuto::applyInitialValue):
(WebCore::ApplyPropertyAuto::applyValue):
(WebCore::ApplyPropertyClip::applyInheritValue):
(WebCore::ApplyPropertyClip::applyInitialValue):
(WebCore::ApplyPropertyClip::applyValue):
(WebCore::ApplyPropertyColor::applyInheritValue):
(WebCore::ApplyPropertyColor::applyInitialValue):
(WebCore::ApplyPropertyColor::applyValue):
(WebCore::ApplyPropertyDirection::applyValue):
(WebCore::ApplyPropertyLength::applyValue):
(WebCore::ApplyPropertyString::applyValue):
(WebCore::ApplyPropertyBorderRadius::applyValue):
(WebCore::ApplyPropertyFillLayer::applyInheritValue):
(WebCore::ApplyPropertyFillLayer::applyInitialValue):
(WebCore::ApplyPropertyFillLayer::applyValue):
(WebCore::ApplyPropertyComputeLength::applyValue):
(WebCore::ApplyPropertyFont::applyInheritValue):
(WebCore::ApplyPropertyFont::applyInitialValue):
(WebCore::ApplyPropertyFont::applyValue):
(WebCore::ApplyPropertyFontSize::applyInheritValue):
(WebCore::ApplyPropertyFontSize::applyInitialValue):
(WebCore::ApplyPropertyFontSize::applyValue):
(WebCore::ApplyPropertyFontWeight::applyValue):
(WebCore::ApplyPropertyFontVariantLigatures::applyInheritValue):
(WebCore::ApplyPropertyFontVariantLigatures::applyInitialValue):
(WebCore::ApplyPropertyFontVariantLigatures::applyValue):
(WebCore::ApplyPropertyBorderImage::applyValue):
(WebCore::ApplyPropertyBorderImageModifier::applyInheritValue):
(WebCore::ApplyPropertyBorderImageModifier::applyInitialValue):
(WebCore::ApplyPropertyBorderImageModifier::applyValue):
(WebCore::ApplyPropertyBorderImageSource::applyValue):
(WebCore::ApplyPropertyCounter::emptyFunction):
(WebCore::ApplyPropertyCounter::applyInheritValue):
(WebCore::ApplyPropertyCounter::applyValue):
(WebCore::ApplyPropertyCursor::applyInheritValue):
(WebCore::ApplyPropertyCursor::applyInitialValue):
(WebCore::ApplyPropertyCursor::applyValue):
(WebCore::ApplyPropertyTextAlign::applyValue):
(WebCore::ApplyPropertyTextDecoration::applyValue):
(WebCore::ApplyPropertyLineHeight::applyValue):
(WebCore::ApplyPropertyPageSize::applyInheritValue):
(WebCore::ApplyPropertyPageSize::applyInitialValue):
(WebCore::ApplyPropertyPageSize::applyValue):
(WebCore::ApplyPropertyTextEmphasisStyle::applyInheritValue):
(WebCore::ApplyPropertyTextEmphasisStyle::applyInitialValue):
(WebCore::ApplyPropertyTextEmphasisStyle::applyValue):
(WebCore::ApplyPropertyAnimation::applyInheritValue):
(WebCore::ApplyPropertyAnimation::applyInitialValue): If the property is
CSSPropertyWebkitTransitionProperty, call setAnimationMode(Animation::AnimateAll).
(WebCore::ApplyPropertyAnimation::applyValue):
(WebCore::ApplyPropertyOutlineStyle::applyInheritValue):
(WebCore::ApplyPropertyOutlineStyle::applyInitialValue):
(WebCore::ApplyPropertyOutlineStyle::applyValue):
(WebCore::ApplyPropertyResize::applyValue):
(WebCore::ApplyPropertyVerticalAlign::applyValue):
(WebCore::ApplyPropertyAspectRatio::applyInheritValue):
(WebCore::ApplyPropertyAspectRatio::applyInitialValue):
(WebCore::ApplyPropertyAspectRatio::applyValue):
(WebCore::ApplyPropertyZoom::applyInheritValue):
(WebCore::ApplyPropertyZoom::applyInitialValue):
(WebCore::ApplyPropertyZoom::applyValue):
(WebCore::ApplyPropertyDisplay::applyInheritValue):
(WebCore::ApplyPropertyDisplay::applyInitialValue):
(WebCore::ApplyPropertyDisplay::applyValue):
(WebCore::ApplyPropertyClipPath::applyValue):
(WebCore::ApplyPropertyWrapShape::applyValue):
(WebCore::ApplyPropertyImageResolution::applyInheritValue):
(WebCore::ApplyPropertyImageResolution::applyInitialValue):
(WebCore::ApplyPropertyImageResolution::applyValue):
* css/StyleBuilder.h:
(PropertyHandler):
(WebCore::PropertyHandler::applyInheritValue):
(WebCore::PropertyHandler::applyInitialValue):
(WebCore::PropertyHandler::applyValue):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList): Pass in the property ID.

LayoutTests:

Test with longhand transition-property rule, followed by shorthand
with missing property value. This test should pass, and not assert.

* transitions/longhand-vs-shorthand-initial-expected.txt: Added.
* transitions/longhand-vs-shorthand-initial.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Minimize collisions when hashing pairs
        https://bugs.webkit.org/show_bug.cgi?id=96022

        Build fix (with newer clang?)

        * wtf/HashFunctions.h: (WTF::pairIntHash): Be explicit about casting from
        64 bit to 32 bit.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove webkitPostMessage
https://bugs.webkit.org/show_bug.cgi?id=96577

Reviewed by Ojan Vafai.

.:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

* Source/cmake/WebKitFeatures.cmake:
* Source/cmakeconfig.h.cmake:

Source/JavaScriptCore:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

webkitPostMessage works the same as postMessage. The spec and the
implementation have been stable for a while. We should no longer be
exposing this vendor-prefixed API.

This patch places the webkitPostMessage API behind an ENABLE flag.
We're going to try removing this API in the Chromium port. If we don't
run into trouble, we'll remove it in all the other ports as well.

This topic has been discussed on webkit-dev in
http://lists.webkit.org/pipermail/webkit-dev/2012-April/020237.html and
http://lists.webkit.org/pipermail/webkit-dev/2012-September/022189.html

This patch introduces the ENABLE(LEGACY_VENDOR_PREFIXES) flag. Rather
than having a flag for each vendor-prefixed API we're experimenting
with removing, we'll add vendor prefixed APIs to this ENABLE when we
want to try removing them. If we succeed, we'll just delete the APIs.
If we fail, we'll remove them from the ENABLE. That way we avoid the
churn of adding and removing many ENABLE macros.

* Configurations/FeatureDefines.xcconfig:
* GNUmakefile.am:
* GNUmakefile.features.am:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore):
* bindings/js/JSDedicatedWorkerContextCustom.cpp:
(WebCore):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore):
* bindings/js/JSWorkerCustom.cpp:
(WebCore):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore):
* bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
(WebCore):
* bindings/v8/custom/V8MessagePortCustom.cpp:
(WebCore):
* bindings/v8/custom/V8WorkerCustom.cpp:
(WebCore):
* dom/MessagePort.idl:
* page/DOMWindow.idl:
* workers/DedicatedWorkerContext.idl:
* workers/Worker.idl:

Source/WebKit/chromium:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

* features.gypi:

Source/WebKit/mac:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

* Configurations/FeatureDefines.xcconfig:

Tools:

Add ENABLE_LEGACY_VENDOR_PREFIXES flag.

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

LayoutTests:

Update tests to rely only upon the unprefixed API.

* fast/canvas/webgl/script-tests/arraybuffer-transfer-of-control.js:
(wrapSend):
(wrapFailSend):
* fast/dom/Window/post-message-crash.html:
* fast/dom/Window/window-postmessage-args-expected.txt:
* fast/dom/Window/window-postmessage-args.html:
* fast/events/message-port.html:
* fast/events/resources/message-port-multi.js:
* fast/workers/resources/worker-call.js:
* fast/workers/worker-call-expected.txt:


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

Update fixpos layout test results. Chromium currently doesn't set the fixpos-forms-stacking-context setting in
DumpRenderTree.

* fast/block/positioning/016-expected.png: Copied from LayoutTests/platform/efl/fast/block/positioning/016-expected.png.
* fast/block/positioning/025-expected.png: Renamed from LayoutTests/platform/efl/fast/block/positioning/025-expected.png.
* platform/chromium-linux-x86/compositing/geometry/fixed-position-composited-switch-expected.txt: Added.
* platform/chromium-linux-x86/fast/block/positioning/016-expected.txt: Added.
* platform/chromium-linux-x86/fast/block/positioning/025-expected.txt: Added.
* platform/chromium-linux-x86/fast/block/positioning/fixed-position-stacking-context-expected.txt: Added.
* platform/chromium-linux/compositing/geometry/fixed-position-composited-switch-expected.txt: Added.
* platform/chromium-linux/fast/block/positioning/016-expected.png: Renamed from LayoutTests/platform/gtk/fast/block/positioning/016-expected.png.
* platform/chromium-linux/fast/block/positioning/016-expected.txt: Added.
* platform/chromium-linux/fast/block/positioning/025-expected.png: Renamed from LayoutTests/platform/gtk/fast/block/positioning/025-expected.png.
* platform/chromium-linux/fast/block/positioning/025-expected.txt: Added.
* platform/chromium-linux/fast/block/positioning/fixed-position-stacking-context-expected.png: Renamed from LayoutTests/platform/efl/fast/block/positioning/016-expected.png.
* platform/chromium-linux/fast/block/positioning/fixed-position-stacking-context-expected.txt: Added.
* platform/chromium-mac-snowleopard/compositing/geometry/fixed-position-composited-switch-expected.txt: Added.
* platform/chromium-mac-snowleopard/fast/block/positioning/016-expected.txt: Added.
* platform/chromium-mac-snowleopard/fast/block/positioning/025-expected.txt: Added.
* platform/chromium-mac-snowleopard/fast/block/positioning/fixed-position-stacking-context-expected.txt: Added.
* platform/chromium-mac/compositing/geometry/fixed-position-composited-switch-expected.txt: Added.
* platform/chromium-mac/fast/block/positioning/016-expected.png: Added.
* platform/chromium-mac/fast/block/positioning/016-expected.txt: Added.
* platform/chromium-mac/fast/block/positioning/025-expected.png: Added.
* platform/chromium-mac/fast/block/positioning/025-expected.txt: Added.
* platform/chromium-mac/fast/block/positioning/fixed-position-stacking-context-expected.png: Added.
* platform/chromium-mac/fast/block/positioning/fixed-position-stacking-context-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix builds with CSS_IMAGE_RESOLUTION enabled after r128656.

* css/StyleBuilder.cpp:
(WebCore::ApplyPropertyImageResolution::applyInheritValue):
(WebCore::ApplyPropertyImageResolution::applyInitialValue):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add expectations for tests that depend on other tests running before them.
Filed a bug for each with information on which test it depends on.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
mac-future ignores previous platform TestExpectations.
https://bugs.webkit.org/show_bug.cgi?id=96718.

Reviewed by Dirk Pranke.

TestExpectations match an expectation's configuraton against a list of configurations that are
valid for that port.  That list does not contain mac-future so none of the expectations can be
applied.

* Scripts/webkitpy/layout_tests/port/apple.py:
(ApplePort._generate_all_test_configurations):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Provide a runtime setting to disable position:sticky
https://bugs.webkit.org/show_bug.cgi?id=96827

Reviewed by James Robinson.

Source/WebCore:

Have it be on by default so that only ports that both enable
the define and don't want it on by default need to do something special.

* css/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
(WebCore::isValidKeywordPropertyAndValue):
* css/CSSParserMode.h:
(CSSParserContext):
* dom/Document.cpp:
(WebCore::Document::cssStickyPositionEnabled):
(WebCore):
* dom/Document.h:
(Document):
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(Settings):
(WebCore::Settings::setCSSStickyPositionEnabled):
(WebCore::Settings::cssStickyPositionEnabled):

Source/WebKit/chromium:

* public/WebSettings.h:
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::setCSSStickyPositionEnabled):
(WebKit):
* src/WebSettingsImpl.h:
(WebSettingsImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
new fast/loader tests from r128645 fail on Mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=96832.

Unreviewed.

Update TestExpectations

* platform/mac-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Unreviewed.
        
        A small improvement to this flaky test: use a correct URL, so that the test fails
        quickly and understandably instead of timing out. This code path didn't use to be
        taken before, so the URL was always wrong.

        * fast/loader/resources/submit-form-while-parsing-subframe.html:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shaders] u_textureSize uniform should be set to the size of the texture.
https://bugs.webkit.org/show_bug.cgi?id=95914

Reviewed by Dean Jackson.

Source/WebCore:

This adds support for the following shader uniform variables:

    uniform vec2 u_textureSize
    uniform vec4 u_meshBox
    uniform vec2 u_tileSize
    uniform vec2 u_meshSize

The relevant section of the specification is:
http://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html#shader-uniform-variables

Tests: css3/filters/custom/custom-filter-u-mesh-box.html
       css3/filters/custom/custom-filter-u-mesh-size.html
       css3/filters/custom/custom-filter-u-texture-size.html
       css3/filters/custom/custom-filter-u-tile-size.html

* platform/graphics/filters/FECustomFilter.cpp:
(WebCore::FECustomFilter::bindProgramAndBuffers):

LayoutTests:

Tests for the following uniform variables:
    uniform vec2 u_textureSize
    uniform vec4 u_meshBox
    uniform vec2 u_tileSize
    uniform vec2 u_meshSize

The relevant section of the specification is:
http://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html#shader-uniform-variables

* css3/filters/custom/custom-filter-u-mesh-box-expected.html: Added.
* css3/filters/custom/custom-filter-u-mesh-box.html: Added.
* css3/filters/custom/custom-filter-u-mesh-size-expected.html: Added.
* css3/filters/custom/custom-filter-u-mesh-size.html: Added.
* css3/filters/custom/custom-filter-u-texture-size-expected.html: Added.
* css3/filters/custom/custom-filter-u-texture-size.html: Added.
* css3/filters/custom/custom-filter-u-tile-size-expected.html: Added.
* css3/filters/custom/custom-filter-u-tile-size.html: Added.
* css3/filters/resources/u-mesh-box-is-unit-square.fs: Added.
* css3/filters/resources/u-mesh-size.fs: Added.
* css3/filters/resources/u-texture-size.fs: Added.
* css3/filters/resources/u-tile-size.fs: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128666 268f45cc-cd09-0410-ab3c-d52691b4dbfc
bbc homepage crashes immediately
https://bugs.webkit.org/show_bug.cgi?id=96812
<rdar://problem/12081386>

Reviewed by Oliver Hunt.

If you use the old storage pointer to write to space you thought was newly allocated,
you're going to have a bad time.

* runtime/JSArray.cpp:
(JSC::JSArray::unshiftCount):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mark compositing/geometry/fixed-position-transform-composited-page-scale.html flaky
as it's flaky on all the Chromium bots.
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove V8DOMWindowShell::getEntered
https://bugs.webkit.org/show_bug.cgi?id=96637

Patch by Dan Carney <dcarney@google.com> on 2012-09-14
Reviewed by Adam Barth.

V8DOMWindowShell::getEntered was refactored so that the window shell
no longer has to be kept alive by a v8 context but rather a smaller
object.

No new tests. No change in functionality.

* bindings/v8/DOMData.cpp:
(WebCore::DOMData::getCurrentStore):
* bindings/v8/ScopedPersistent.h:
(WebCore::ScopedPersistent::leakHandle):
(ScopedPersistent):
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::resetIsolatedWorlds):
(WebCore::ScriptController::evaluateInIsolatedWorld):
(WebCore::ScriptController::currentWorldContext):
* bindings/v8/V8Binding.cpp:
(WebCore::perContextDataForCurrentWorld):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::setIsolatedWorldField):
(WebCore::V8DOMWindowShell::toIsolatedContextData):
(WebCore::isolatedContextWeakCallback):
(WebCore::V8DOMWindowShell::disposeContext):
(WebCore::V8DOMWindowShell::clearIsolatedShell):
(WebCore):
(WebCore::V8DOMWindowShell::initializeIfNeeded):
(WebCore::V8DOMWindowShell::setIsolatedWorldSecurityOrigin):
* bindings/v8/V8DOMWindowShell.h:
(V8DOMWindowShell):
(IsolatedContextData):
(WebCore::V8DOMWindowShell::IsolatedContextData::create):
(WebCore::V8DOMWindowShell::IsolatedContextData::world):
(WebCore::V8DOMWindowShell::IsolatedContextData::perContextData):
(WebCore::V8DOMWindowShell::IsolatedContextData::setSecurityOrigin):
(WebCore::V8DOMWindowShell::IsolatedContextData::securityOrigin):
(WebCore::V8DOMWindowShell::IsolatedContextData::IsolatedContextData):
(WebCore::V8DOMWindowShell::enteredIsolatedContext):
(WebCore::V8DOMWindowShell::enteredIsolatedContextData):
* bindings/v8/V8DOMWrapper.h:
(WebCore::V8DOMWrapper::getCachedWrapper):
* bindings/v8/WorldContextHandle.cpp:
(WebCore::WorldContextHandle::WorldContextHandle):
* bindings/v8/custom/V8DocumentCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8SVGDocumentCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8XMLHttpRequestConstructor.cpp:
(WebCore::V8XMLHttpRequest::constructorCallback):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSC should throw a more descriptive exception when blocking 'eval' via CSP.
https://bugs.webkit.org/show_bug.cgi?id=94331

Patch by Mike West <mkwst@chromium.org> on 2012-09-14
Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Unless explicitly whitelisted, the 'script-src' Content Security Policy
directive blocks 'eval' and 'eval'-like constructs such as
'new Function()'. When 'eval' is encountered in code, an 'EvalError' is
thrown, but the associated message is poor: "Eval is disabled" doesn't
give developers enough information about why their code isn't behaving
as expected.

This patch adds an 'errorMessage' parameter to the JavaScriptCore method
used to disable 'eval'; ContentSecurityPolicy has the opportunity to
pass in a more detailed and descriptive error that contains more context
for the developer.

* runtime/Executable.cpp:
(JSC::EvalExecutable::compileInternal):
    Drop the hard-coded "Eval is disabled" error message in favor of
    reading the error message off the global object.
* runtime/FunctionConstructor.cpp:
(JSC::FunctionConstructor::getCallData):
    Drop the hard-coded "Function constructor is disabled" error message
    in favor of reading the error message off the global object.
* runtime/JSGlobalObject.h:
(JSGlobalObject):
(JSC::JSGlobalObject::evalEnabled):
    Making this accessor method const.
(JSC::JSGlobalObject::evalDisabledErrorMessage):
    Accessor for the error message set via 'setEvalDisabled'.
(JSC::JSGlobalObject::setEvalEnabled):
    Adding an 'errorMessage' parameter which is stored on the global
    object, and used when exceptions are thrown.

Source/WebCore:

Unless explicitly whitelisted, the 'script-src' Content Security Policy
directive blocks 'eval' and 'eval'-like constructs such as
'new Function()'. When 'eval' is encountered in code, an 'EvalError' is
thrown, but the associated message is poor: "Eval is disabled" doesn't
give developers enough information about why their code isn't behaving
as expected.

This patch adds an 'errorMessage' parameter to the JavaScriptCore method
used to disable 'eval'; ContentSecurityPolicy has the opportunity to
pass in a more detailed and descriptive error that contains more context
for the developer.

The new error message is tested by adjusting existing tests; nothing new
is required.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::initScript):
    Read the error message off the document's ContentSecurityPolicy.
(WebCore::ScriptController::disableEval):
* bindings/js/ScriptController.h:
(ScriptController):
    Pipe the error message through to JSGlobalObject when disabling eval
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::disableEval):
* bindings/js/WorkerScriptController.h:
(WorkerScriptController):
    Pipe the error message through to JSGlobalObject when disabling eval
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::disableEval):
* bindings/v8/ScriptController.h:
(ScriptController):
* bindings/v8/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::disableEval):
* bindings/v8/WorkerScriptController.h:
(WorkerScriptController):
    Placeholder for V8 piping to be built in webk.it/94332.
* dom/Document.cpp:
(WebCore::Document::disableEval):
* dom/Document.h:
(Document):
* dom/ScriptExecutionContext.h:
(ScriptExecutionContext):
    Pipe the error message through to the ScriptController when
    disabling eval.
* page/ContentSecurityPolicy.cpp:
(WebCore::CSPDirectiveList::evalDisabledErrorMessage):
    Accessor for the error message that ought be displayed to developers
    when 'eval' used while disabled for a specific directive list.
(WebCore::CSPDirectiveList::setEvalDisabledErrorMessage):
    Mutator for the error message that ought be displayed to developers
    when 'eval' used while disabled for a specific directive list.
(CSPDirectiveList):
(WebCore::CSPDirectiveList::create):
    Upon creation of a CSPDirectiveList, set the error message if the
    directive list disables 'eval'.
(WebCore::ContentSecurityPolicy::didReceiveHeader):
    Pass the error message into ScriptExecutionContext::disableEval.
(WebCore::ContentSecurityPolicy::evalDisabledErrorMessage):
    Public accessor for the policy's error message; walks the list of
    directive lists and returns the first error message found.
(WebCore):
* page/ContentSecurityPolicy.h:
* workers/WorkerContext.cpp:
(WebCore::WorkerContext::disableEval):
* workers/WorkerContext.h:
(WorkerContext):
    Pipe the error message through to the ScriptController when
    disabling eval.

LayoutTests:

* http/tests/security/contentSecurityPolicy/eval-blocked-expected.txt:
* http/tests/security/contentSecurityPolicy/eval-blocked-in-about-blank-iframe-expected.txt:
* http/tests/security/contentSecurityPolicy/function-constructor-blocked-expected.txt:

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