opaqueJSClassData should be cached on JSGlobalObject, not the JSGlobalData
https://bugs.webkit.org/show_bug.cgi?id=113086

Reviewed by Geoffrey Garen.

opaqueJSClassData stores cached prototypes for JSClassRefs in the C API. It doesn't make sense to 
share these prototypes within a JSGlobalData across JSGlobalObjects, and in fact doing so will cause 
a leak of the original JSGlobalObject that these prototypes were created in. Therefore we should move 
this cache to JSGlobalObject where it belongs and where it won't cause memory leaks.

* API/JSBase.cpp: Needed to add an extern "C" so that testapi.c can use the super secret GC function.
* API/JSClassRef.cpp: We now grab the cached context data from the global object rather than the global data.
(OpaqueJSClass::contextData):
* API/JSClassRef.h: Remove this header because it's unnecessary and causes circular dependencies.
* API/tests/testapi.c: Added a new test that makes sure that using the same JSClassRef in two different contexts
doesn't cause leaks of the original global object.
(leakFinalize):
(nestedAllocateObject): This is a hack to bypass the conservative scan of the GC, which was unnecessarily marking
objects and keeping them alive, ruining the test result.
(testLeakingPrototypesAcrossContexts):
(main):
* API/tests/testapi.mm: extern "C" this so we can continue using it here.
* runtime/JSGlobalData.cpp: Remove JSClassRef related stuff.
(JSC::JSGlobalData::~JSGlobalData):
* runtime/JSGlobalData.h:
(JSGlobalData):
* runtime/JSGlobalObject.h: Add the stuff that JSGlobalData had. We add it to JSGlobalObjectRareData so that 
clients who don't use the C API don't have to pay the memory cost of this extra HashMap.
(JSGlobalObject):
(JSGlobalObjectRareData):
(JSC::JSGlobalObject::opaqueJSClassData):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shaders] Clamp css_MixColor before the blending and compositing steps
https://bugs.webkit.org/show_bug.cgi?id=113088

Reviewed by Dean Jackson.

Source/WebCore:

The blending and compositing operations from the spec [1] expect that they are operating on
valid color inputs, in the range [0.0, 1.0]. Thus, we should clamp the css_MixColor input to
this range to avoid implementation-dependent behavior for invalid color inputs.

[1]: https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blending

Tests: css3/filters/custom/custom-filter-clamp-css-mix-color-negative.html
       css3/filters/custom/custom-filter-clamp-css-mix-color.html

* platform/graphics/filters/CustomFilterValidatedProgram.cpp:
(WebCore::CustomFilterValidatedProgram::rewriteMixFragmentShader):
    Clamp css_MixColor as clampedMixColor before using it in the blending and compositing
    steps.

LayoutTests:

* css3/filters/custom/custom-filter-clamp-css-mix-color-expected.html: Added.
* css3/filters/custom/custom-filter-clamp-css-mix-color-negative-expected.html: Added.
* css3/filters/custom/custom-filter-clamp-css-mix-color-negative.html: Added.
* css3/filters/custom/custom-filter-clamp-css-mix-color.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r146272): layout issues for flex boxes that have -webkit-flex-wrap: wrap
https://bugs.webkit.org/show_bug.cgi?id=113071

Reviewed by Ojan Vafai.

Source/WebCore:

The refactor in r139535 introduced this bug, where a variable name wasn't updated properly.
In combination with r146272, this bug became more visible when nesting multiline flexboxen.

Test: css3/flexbox/multiline-min-preferred-width.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): We want the width of the widest
flexitem, the value in m_minPreferredWidth isn't relevant. Also update the comment for max
preferred width.

LayoutTests:

* css3/flexbox/multiline-min-preferred-width-expected.txt: Added.
* css3/flexbox/multiline-min-preferred-width.html: Added.


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