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
The cr-linux-ews thinks http/tests/cache/post-redirect-get.php and http/tests/cache/post-with-cached-subresources.php are MISSING results
https://bugs.webkit.org/show_bug.cgi?id=95215

Reviewed by Adam Barth.

Apparently, marking these as missing did not fix the EWS problem,
so remove them from TestExpectations.

* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mark svg/carto.net/selectionlist.svg as flaky because it depends on svg/carto.net/button.svg
running first in order to pass.
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Turn forbidEventDispatch and allowEventDispatch into a RAII object
https://bugs.webkit.org/show_bug.cgi?id=96717

Reviewed by Abhishek Arya.

Replaced forbidEventDispatch and allowEventDispatch by AssertNoEventDispatch.

* dom/ContainerNode.cpp:
(WebCore):
(WebCore::ContainerNode::insertBeforeCommon):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::removeBetween):
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::appendChild):
(WebCore::ContainerNode::parserAddChild):
(WebCore::dispatchChildInsertionEvents):
(WebCore::dispatchChildRemovalEvents):
* dom/ContainerNode.h:
(AssertNoEventDispatch):
(WebCore::AssertNoEventDispatch::AssertNoEventDispatch):
(WebCore::AssertNoEventDispatch::~AssertNoEventDispatch):
(WebCore::AssertNoEventDispatch::isEventDispatchForbidden):
(WebCore):
* dom/ContainerNodeAlgorithms.h:
(WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
(WebCore::ChildNodeInsertionNotifier::notify):
(WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromTree):
* dom/Document.cpp:
(WebCore::Document::dispatchWindowEvent):
(WebCore::Document::dispatchWindowLoadEvent):
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent):
* dom/EventTarget.cpp:
(WebCore):
(WebCore::EventTarget::fireEventListeners):
* dom/EventTarget.h:
(WebCore):
* dom/Node.cpp:
(WebCore::Node::dispatchSubtreeModifiedEvent):
(WebCore::Node::dispatchFocusInEvent):
(WebCore::Node::dispatchFocusOutEvent):
(WebCore::Node::dispatchDOMActivateEvent):
* dom/WebKitNamedFlow.cpp:
(WebCore::WebKitNamedFlow::dispatchRegionLayoutUpdateEvent):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadInternal):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Calling close() during upgradeneeded handler should fire error at open request
https://bugs.webkit.org/show_bug.cgi?id=96807

Reviewed by Tony Chang.

Source/WebCore:

Per spec, if the database connection is closed before the success event fires, the request
should have an error event of type AbortError fired at it.

Test: storage/indexeddb/intversion-close-in-upgradeneeded.html

* Modules/indexeddb/IDBDatabase.h:
(WebCore::IDBDatabase::isClosePending): Expose this state so an in-flight success can be morphed.
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::close): Fire the appropriate error at connections that are mid-opening.
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onSuccess): If the connection was closed before the success is enqueued -
which can happen in multi-process ports with asynchronous messaging - convert the success to an error.

LayoutTests:

Update the test to match the spec behavior.

* storage/indexeddb/intversion-close-in-upgradeneeded-expected.txt:
* storage/indexeddb/resources/intversion-close-in-upgradeneeded.js:
(deleteSuccess):
(upgradeNeeded.transaction.oncomplete):
(upgradeNeeded):
(openError):


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