Fix thread safety issue in AudioParamTimeline
https://bugs.webkit.org/show_bug.cgi?id=100154

Reviewed by Kenneth Russell.

Add appropriate locking in AudioParamTimeline::valueForContextTime()

* Modules/webaudio/AudioParamTimeline.cpp:
(WebCore::AudioParamTimeline::valueForContextTime):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
In the open-source jpeg decoder, read image orientation from the exif data
https://bugs.webkit.org/show_bug.cgi?id=100144

Reviewed by Eric Seidel.

This will be used to implement the shouldRespectImageOrientation
setting (see bug 19688). Currently this isn't hooked up anywhere, so
it has no observable effect for now.

Once it's hooked up, it will be tested by
fast/images/exif-orientation.html

* platform/graphics/BitmapImage.h:
* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageDecoder::orientation):
(ImageDecoder):
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::readUint16):
(WebCore):
(WebCore::readUint32):
(WebCore::checkExifHeader):
(WebCore::readImageOrientation):
(WebCore::JPEGImageReader::JPEGImageReader):
(WebCore::JPEGImageReader::decode):
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
(WebCore::JPEGImageDecoder::setOrientation):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WTFURL: Implement KURL::setPort()
https://bugs.webkit.org/show_bug.cgi?id=99898

Reviewed by Adam Barth.

Source/WebCore: 

* platform/KURLWTFURL.cpp:
(WebCore::KURL::setPort):

Source/WTF: 

Add an efficient implementation for remplacing the port component
in an URL. This will be the base for replacing other components
efficiently.

The testing is covered by fast/dom/HTMLAnchorElement/set-href-attribute-port.html

* wtf/url/api/ParsedURL.cpp:
(WTF::generateNewSpecWithPort):
(WTF::replacePortWithString):
(WTF::ParsedURL::replacePort):
* wtf/url/api/ParsedURL.h:
(ParsedURL):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Chromium window build system does not rebuild correctly when enabling/disabling a feature
https://bugs.webkit.org/show_bug.cgi?id=38926

Reviewed by Eric Seidel.

Remove hack for clobbering build when features.gypi changes. Now that
Chromium requires VS2010 or newer, this bug has gone away.

* Scripts/update-webkit:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Properly skipping http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout*
tests, as was the author's intention.

* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MathML] Symbol font uses greek letters for roman ones on linux and Windows
https://bugs.webkit.org/show_bug.cgi?id=99921

Reviewed by Eric Seidel.

Source/WebCore: 

For parts of stretched parentheses and brackets, mathml.css currently uses the Symbol font,
which on linux and Windows has greek letters at roman code points. To fix this, we switch
to the STIXSizeOneSym font when available. However, this can cause vertical gaps between
glyph parts, because of hard-coded constants in RenderMathMLOperator.cpp. We eliminate all
these constants. We also shift glyphs upward by 1px and truncate them to avoid the gaps.

Tested by existing tests, and one test added to LayoutTests/mathml/presentation/mo.xhtml.

* css/mathml.css:
(math, mfenced > *):
    - Set font-family for mn, mi, etc.
(mo, mfenced):
    - Set font-family for mo and anonymous operators, including extension glyphs for
      stretched operators like parentheses and brackets.
(math):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore):
    - Change 0x23d0 to 0x23aa for STIX & Cambria Math fonts.
(WebCore::RenderMathMLOperator::glyphHeightForCharacter):
(WebCore::RenderMathMLOperator::updateFromElement):
(WebCore::RenderMathMLOperator::createStackableStyle):
    - Eliminate unused lineHeight and topRelative parameters, and the hard-coded font size
      of 14.
(WebCore::RenderMathMLOperator::createGlyph):
    - Eliminate unused lineHeight and topRelative parameters.
* rendering/mathml/RenderMathMLOperator.h:
(RenderMathMLOperator):

Tools: 

Enable the STIXSizeOneSym font for testing.

* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet):
* WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm:
(WTR::allowedFontFamilySet):

LayoutTests: 

* mathml/presentation/mo.xhtml:
* platform/chromium/TestExpectations:
* platform/chromium/mathml/presentation/attributes-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/attributes-expected.txt:
* platform/chromium/mathml/presentation/fenced-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/fenced-expected.txt:
* platform/chromium/mathml/presentation/fenced-mi-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/fenced-mi-expected.txt:
* platform/chromium/mathml/presentation/fractions-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/fractions-expected.txt:
* platform/chromium/mathml/presentation/fractions-vertical-alignment-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/fractions-vertical-alignment-expected.txt:
* platform/chromium/mathml/presentation/mo-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/mo-expected.txt:
* platform/chromium/mathml/presentation/mo-stretch-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/mo-stretch-expected.txt:
* platform/chromium/mathml/presentation/mroot-pref-width-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/mroot-pref-width-expected.txt:
* platform/chromium/mathml/presentation/over-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/over-expected.txt:
* platform/chromium/mathml/presentation/roots-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/roots-expected.txt:
* platform/chromium/mathml/presentation/row-alignment-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/row-alignment-expected.txt:
* platform/chromium/mathml/presentation/row-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/row-expected.txt:
* platform/chromium/mathml/presentation/style-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/style-expected.txt:
* platform/chromium/mathml/presentation/sub-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/sub-expected.txt:
* platform/chromium/mathml/presentation/subsup-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/subsup-expected.txt:
* platform/chromium/mathml/presentation/sup-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/sup-expected.txt:
* platform/chromium/mathml/presentation/tables-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/tables-expected.txt:
* platform/chromium/mathml/presentation/tokenElements-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/tokenElements-expected.txt:
* platform/chromium/mathml/presentation/under-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/under-expected.txt:
* platform/chromium/mathml/presentation/underover-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/underover-expected.txt:
* platform/chromium/mathml/xHeight-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/xHeight-expected.txt:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebGL] conformance/textures/texture-size.html is failing on Apple Mountain Lion
https://bugs.webkit.org/show_bug.cgi?id=94041

Reviewed by Dean Jackson.

When binding a texture to GL_TEXTURE_2D when GL_ACTIVE_TEXTURE is 0, we set m_boundTexture0 to the texture unit.
However when we delete the texture, we need to be setting m_boundTexture0 to 0.
Otherwise when we draw to the screen we bind m_boundTexture0 in the prepareTexture() method and since the associated texture
has already been deleted we end up in an error state.

Tested using Khronos WebGL conformance suite:
conformance/textures/texture-size.html

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::deleteTexture):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shaders] Changing the blend mode in CSS doesn't update the custom filter rendering
https://bugs.webkit.org/show_bug.cgi?id=99887

Patch by Max Vujovic <mvujovic@adobe.com> on 2012-10-23
Reviewed by Dirk Schulze.

Source/WebCore:

Before this patch, WebKit would not recompute an element's style when just its custom filter
blend mode changed.

For example, suppose an element initially has the style:
-webkit-filter: custom(none mix(url(shader.fs) multiply source-atop));

Then, we change the blend mode from "multiply" to "normal":
-webkit-filter: custom(none mix(url(shader.fs) normal source-atop));

WebKit now detects this change and recomputes the style.

CustomFilterProgram now has an equals operator that considers the program type and the mix
settings. The mix settings contain the blend mode.

Test: css3/filters/custom/custom-filter-change-blend-mode.html

* platform/graphics/filters/CustomFilterProgram.cpp:
(WebCore::CustomFilterProgram::operator==):
    Previously, the equals operator was pure virtual in CustomFilterProgram. Now,
    CustomFilterProgram implements it and compares the program type and mix settings, if
    appropriate.
(WebCore):
* platform/graphics/filters/CustomFilterProgram.h:
* platform/graphics/filters/CustomFilterProgramInfo.cpp:
(WebCore::CustomFilterProgramInfo::hash):
    Refactor a repeated condition into a boolean to improve readability.
(WebCore::CustomFilterProgramInfo::operator==):
    Refactor repeated conditions to improve readability. Reorder the conditions so the less
    expensive ones occur first.
* rendering/style/StyleCustomFilterProgram.h:
(WebCore::StyleCustomFilterProgram::operator==):
    Call the base class's equals operator.

LayoutTests:

Add a test that resolves a custom filter's style with the "multiply" blend mode and then
changes the blend mode to "normal". The test makes sure not to change any other parameters
besides the blend mode, since the other parameters can trigger style recalculations on their
own.

* css3/filters/custom/custom-filter-change-blend-mode-expected.html: Added.
* css3/filters/custom/custom-filter-change-blend-mode.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132266 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shaders] Implement all composite operators except destination and lighter.
https://bugs.webkit.org/show_bug.cgi?id=97859

Patch by Huang Dongsung <luxtella@company100.net> on 2012-10-23
Reviewed by Dean Jackson.

Source/WebCore:

Add expressions for all composite operators except destination and
lighter. The expressions are lifted directly from the CSS Compositing
and Blending spec [1]. WebKit adds these compositing expressions to the
author's shader.

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

Test: css3/filters/custom/custom-filter-composite-operators.html

* platform/graphics/filters/CustomFilterCompiledProgram.cpp:
(WebCore::CustomFilterCompiledProgram::initializeParameterLocations):
    Remove ASSERTION checking if glGetUniformLocation returns negative,
    because ASSERTION can fail with clear and copy composite operations.
    Clear and copy composite operations do not need "css_u_texture"
    representing the DOM element texture. If the driver compiler is
    smart, "css_u_texture" is not regarded as an active uniform, so
    glGetuniformLocation returns -1. glGetAttribLocation ditto.
* platform/graphics/filters/CustomFilterValidatedProgram.cpp:
(WebCore::CustomFilterValidatedProgram::compiledProgram):
    Move the above ASSERTION in CustomFilterCompiledProgram to here.
    ASSERTION checks if m_samplerLocation is not -1 when the author
    shader needs an input texture.
(WebCore::CustomFilterValidatedProgram::needsInputTexture):
(WebCore):
(WebCore::CustomFilterValidatedProgram::compositeFunctionString):
* platform/graphics/filters/CustomFilterValidatedProgram.h:
(CustomFilterValidatedProgram):

LayoutTests:

Add test to check that the DOM element texture composites correctly with the css_MixColor
variable from the author's shader for each composite operator.

* css3/filters/custom/custom-filter-composite-operators-expected.png: Added.
* css3/filters/custom/custom-filter-composite-operators-expected.txt: Added.
* css3/filters/custom/custom-filter-composite-operators.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shaders] Implement overlay, color-dodge, color-burn, hard-light, soft-light blend modes.
https://bugs.webkit.org/show_bug.cgi?id=98504

Patch by Huang Dongsung <luxtella@company100.net> on 2012-10-23
Reviewed by Dean Jackson.

Source/WebCore:

Add expressions for the aforementioned blend modes. The expressions are lifted
directly from the CSS Compositing and Blending spec [1]. WebKit adds these
blending expressions to the author's shader.

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

Test: css3/filters/custom/custom-filter-blend-modes.html

* platform/graphics/filters/CustomFilterValidatedProgram.cpp:
(WebCore::CustomFilterValidatedProgram::rewriteMixFragmentShader):
(WebCore::CustomFilterValidatedProgram::blendFunctionString):

LayoutTests:

Update the test for the aforementioned blend modes.

* css3/filters/custom/custom-filter-blend-modes-expected.html:
* css3/filters/custom/custom-filter-blend-modes.html:

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