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