BasicShapePolygon::path takes width instead of height for boundary calculation
https://bugs.webkit.org/show_bug.cgi?id=99919

Reviewed by Darin Adler.

Source/WebCore:

The 'y' parameters of polygon were calculated by the with of the bounding box of the object.
This caused problems on percentage values for point positions.
Changed it to the height of the bounding box.

Test: css3/masking/clip-path-polygon-percentage.html

* rendering/style/BasicShapes.cpp:
(WebCore::BasicShapePolygon::path):

LayoutTests:

Test that the correct relation is used for calculating point position of an polygon.

* css3/masking/clip-path-polygon-percentage-expected.html: Added.
* css3/masking/clip-path-polygon-percentage.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: refactor backend to use IDB*Metadata
https://bugs.webkit.org/show_bug.cgi?id=100055

Reviewed by Tony Chang.

Source/WebCore:

This further encapsulates the static data in
IDBObjectStoreBackendImpl and IDBIndexBackendImp into their
respective IDB*Metadata structs, in preparation for
https://bugs.webkit.org/show_bug.cgi?id=99774.

No new tests as this is purely a refactor.

* Modules/indexeddb/IDBBackingStore.h:
(IDBBackingStore):
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::createObjectStore):
(WebCore::IDBDatabaseBackendImpl::loadObjectStores):
* Modules/indexeddb/IDBIndexBackendImpl.cpp:
(WebCore::IDBIndexBackendImpl::IDBIndexBackendImpl):
(WebCore::IDBIndexBackendImpl::metadata):
* Modules/indexeddb/IDBIndexBackendImpl.h:
(WebCore::IDBIndexBackendImpl::create):
(WebCore::IDBIndexBackendImpl::id):
(WebCore::IDBIndexBackendImpl::setId):
(WebCore::IDBIndexBackendImpl::hasValidId):
(WebCore::IDBIndexBackendImpl::name):
(WebCore::IDBIndexBackendImpl::keyPath):
(WebCore::IDBIndexBackendImpl::unique):
(WebCore::IDBIndexBackendImpl::multiEntry):
(IDBIndexBackendImpl):
* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::getObjectStores):
(WebCore::IDBLevelDBBackingStore::getIndexes):
* Modules/indexeddb/IDBLevelDBBackingStore.h:
(IDBLevelDBBackingStore):
* Modules/indexeddb/IDBMetadata.h:
(WebCore::IDBObjectStoreMetadata::IDBObjectStoreMetadata):
* Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::IDBObjectStoreBackendImpl):
(WebCore::IDBObjectStoreBackendImpl::metadata):
(WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
(WebCore::IDBObjectStoreBackendImpl::putInternal):
(WebCore::IDBObjectStoreBackendImpl::createIndex):
(WebCore::IDBObjectStoreBackendImpl::loadIndexes):
* Modules/indexeddb/IDBObjectStoreBackendImpl.h:
(WebCore::IDBObjectStoreBackendImpl::create):
(WebCore::IDBObjectStoreBackendImpl::id):
(WebCore::IDBObjectStoreBackendImpl::setId):
(WebCore::IDBObjectStoreBackendImpl::name):
(WebCore::IDBObjectStoreBackendImpl::keyPath):
(WebCore::IDBObjectStoreBackendImpl::autoIncrement):
(IDBObjectStoreBackendImpl):

Source/WebKit/chromium:

Update tests to reflect refactoring.

* tests/IDBDatabaseBackendTest.cpp:
* tests/IDBFakeBackingStore.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
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
Generated should not be supported for things with a shadow
https://bugs.webkit.org/show_bug.cgi?id=98836

Patch by Elliott Sprehn <esprehn@chromium.org> on 2012-10-23
Reviewed by Dimitri Glazkov.

Source/WebCore:

As far as CSS is concerned inputs and things with shadow content inside
shouldn't support pseudo elements like :before, :after or :first-letter.
Neither Gecko or Presto supports it, and we only accidentally supported
it.

Until the spec tells us what to do we should disable support. This is
also neccesary because the new generated content implementation doesn't
support shadows.

Test: fast/forms/pseudo-elements.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderListBox.h: Added missing canHaveGeneratedChildren() that returns false.
* rendering/RenderObjectChildList.cpp:
(WebCore::RenderObjectChildList::updateBeforeAfterContent):

LayoutTests:

Change all pseudos on <input> tests to be ref tests and clean up the tests.
They now make sure we don't support generated content on things with a shadow.
Also added another test for the other form control types to ensure they don't
support pseudos either.

* fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.html: Added.
* fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
* fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements.html:
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.html: Added.
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements.html:
* fast/forms/pseudo-elements-expected.html: Added.
* fast/forms/pseudo-elements.html: Added.
* fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.html: Added.
* fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
* fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements.html:
* fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.html: Added.
* fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
* fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements.html:
* platform/chromium-linux/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-linux/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-linux/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-win/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-win/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-win/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-win/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shaders] Set FilterOperations on GraphicsLayer after the program of CSS Shaders is loaded.
https://bugs.webkit.org/show_bug.cgi?id=99908

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

CSS Shaders can not render anything until the program is loaded. If there is
partial loaded shaders program, whole FilterOperations chain can not render
anything. It occurs a flash. So We have to wait until the program is loaded, to
prevent a flash as RenderLayerBacking::updateImageContents() waits until an
image is fully loaded.

No new tests, CSS Shaders on Accelerated Compositing are not activated yet.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateFilters):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Popup menus positioning needs to take multiple monitors into account.
https://bugs.webkit.org/show_bug.cgi?id=100158

Reviewed by Timothy Horton.

Add screen.x() to repositioning check to account for position of current monitor.

* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::calculatePositionAndSize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Remove extraneous conversion to String->NSString
https://bugs.webkit.org/show_bug.cgi?id=100044

Reviewed by Darin Adler.

Improve some unfortunate use of String->NSString.

* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification): The variable macNotification is ultimately
needed as NSString, and all its value are or can be NSString.
Convert the last 3 char* values to NSString literal and use NSString* all the way.

* loader/mac/LoaderNSURLExtras.h:
* loader/mac/LoaderNSURLExtras.mm:
(suggestedFilenameWithMIMEType):
We converted the String to NSString to pass to suggestedFilenameWithMIMEType. There is no need
for the string to be a NSSTring there, we can leave it in its original type.

The case checking for a nil MIMEType was dead code because the implicit conversion never returns nil.

* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink):
Use String's nsStringNilIfEmpty().

* platform/mac/HTMLConverter.mm:
(-[WebHTMLConverter _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]):
Fix the coding style. Do the conversion to NSString only when needed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add measurePageLoadTime function to PerfTestRunner
https://bugs.webkit.org/show_bug.cgi?id=100029

Reviewed by Ryosuke Niwa.

Adopt chunk based loading logic from html5-full-render.html into measurePageLoadTime function,
this is needed to measure the performance and the memory consumption of the PageLoadTests as
we do it for all other performancetests.

* Parser/html5-full-render.html: Move the behavior to runner.js.
* resources/runner.js:
(.): Add measurePageLoadTime function.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132273 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change setTargetValueAtTime() to setTargetAtTime()
https://bugs.webkit.org/show_bug.cgi?id=100153

Reviewed by Adam Barth.

Source/WebCore:

The AudioParam method name has changed due to Web Audio API spec review.
Keep legacy support for the old name.

Test: webaudio/audioparam-setTargetAtTime.html

* Modules/webaudio/AudioParam.h:
(WebCore::AudioParam::setTargetAtTime):
* Modules/webaudio/AudioParam.idl:
* Modules/webaudio/AudioParamTimeline.cpp:
(WebCore::AudioParamTimeline::setTargetAtTime):
(WebCore::AudioParamTimeline::valuesForTimeRangeImpl):
* Modules/webaudio/AudioParamTimeline.h:
(AudioParamTimeline):

LayoutTests:

* webaudio/audioparam-setTargetAtTime-expected.txt: Renamed from LayoutTests/webaudio/audioparam-setTargetValueAtTime-expected.txt.
* webaudio/audioparam-setTargetAtTime.html: Renamed from LayoutTests/webaudio/audioparam-setTargetValueAtTime.html.
* webaudio/resources/audioparam-testing.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Coordinated Graphics: Enable threaded/IPC animations
https://bugs.webkit.org/show_bug.cgi?id=93146

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Add enablers to TextureMapper and GraphicsLayerAnimation so that they could be used
across processes with IPC. Added some public accessors to GraphicsLayerAnimation,
and allowed a GraphicsLayerTextureMapper to receive a full list of animations.

Covered by existing animation and compositing tests.

* platform/graphics/GraphicsLayerAnimation.cpp:
(WebCore::GraphicsLayerAnimation::GraphicsLayerAnimation):
    Initialize the animation with the startTime instead of the offset.

(WebCore::GraphicsLayerAnimations::getActiveAnimations):
* platform/graphics/GraphicsLayerAnimation.h:
(WebCore::GraphicsLayerAnimation::setState):
    Allow setting the pause time as well.

(WebCore::GraphicsLayerAnimation::boxSize):
(WebCore::GraphicsLayerAnimation::startTime):
(WebCore::GraphicsLayerAnimation::pauseTime):
(WebCore::GraphicsLayerAnimation::animation):
(WebCore::GraphicsLayerAnimation::keyframes):
(WebCore::GraphicsLayerAnimation::listsMatch):
(WebCore::GraphicsLayerAnimations::size):
(WebCore::GraphicsLayerAnimations::animations):
    Add public accessors to GraphicsLayerAnimation properties.

(GraphicsLayerAnimation):
(GraphicsLayerAnimations):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::addAnimation):
(WebCore::GraphicsLayerTextureMapper::setAnimations):
    Allow replacing the entire list of animations.

(WebCore):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
(GraphicsLayerTextureMapper):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::applyAnimationsRecursively):
(WebCore):
* platform/graphics/texmap/TextureMapperLayer.h:
(TextureMapperLayer):

Source/WebKit2:

Re-enable UI-process animations for Coordinated-Graphics/TextureMapper.
- Added an argument coder for GraphicsLayerAnimations.
- Allow LayerTreeCoordinator to manage the animations per layer with the proxy,
  as opposed to applying the animation values in the web process as before.
- LayerTreeRenderer now calls updateViewport() after painting when an animation is active.

To overcome the problem we've had in the past with synchronizing UI-side and web-side
animations, we now lock the animations in the UI process when a frame starts rendering,
and unlock it when the frame finishes rendering, or if after the layout there is no visible
changes pending on the screen.

* Scripts/webkit2/messages.py:
(headers_for_type):
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(CoreIPC):
(CoreIPC::encodeTimingFunction):
(CoreIPC::decodeTimingFunction):
(CoreIPC::::encode):
(CoreIPC::::decode):
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
(WebCore):
    Added argument coders for GraphicsLayerAnimations.

* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp:
(WebKit::LayerTreeCoordinatorProxy::setLayerAnimations):
(WebKit::LayerTreeCoordinatorProxy::setAnimationsLocked):
* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h:
(LayerTreeCoordinatorProxy):
* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in:
    Added an option to sync the layer's animations, and also to lock/unlock animations.

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::LayerTreeRenderer):
(WebKit::LayerTreeRenderer::paintToCurrentGLContext):
    Sync animations if they're not locked, and call updateViewport() if we have animations.

(WebKit::LayerTreeRenderer::flushLayerChanges):
(WebKit::LayerTreeRenderer::setLayerAnimations):
(WebKit::LayerTreeRenderer::setAnimationsLocked):

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(LayerTreeRenderer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::didChangeAnimations):
(WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::syncLayerState):
(WebCore::CoordinatedGraphicsLayer::syncAnimations):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::addAnimation):
(WebCore::CoordinatedGraphicsLayer::pauseAnimation):
(WebCore::CoordinatedGraphicsLayer::removeAnimation):
(WebCore::CoordinatedGraphicsLayer::animationStartedTimerFired):
(WebCore):
    Pass the animation info to the UI process instead of applying it in the web process.

(WebCore::CoordinatedGraphicsLayer::hasPendingVisibleChanges):
    Compute whether a layer tree might have sync issues or flickers if rendered while
    background animations are ongoing.

(WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
(WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
    Don't allow progressive tiling for layers with animations.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
(WebCore):
(CoordinatedGraphicsLayerClient):
(CoordinatedGraphicsLayer):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::LayerTreeCoordinator):
(WebKit::LayerTreeCoordinator::lockAnimations):
(WebKit):
(WebKit::LayerTreeCoordinator::unlockAnimations):
(WebKit::LayerTreeCoordinator::performScheduledLayerFlush):
(WebKit::LayerTreeCoordinator::setLayerAnimations):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
(LayerTreeCoordinator):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow tests to run with a tile cache, and optionally dump the tile cache via layerTreeAsText()
https://bugs.webkit.org/show_bug.cgi?id=100159

Reviewed by Tim Horton.

Source/WebCore:

Add a LAYER_TREE_INCLUDES_PAGE_TILE_CACHE flag for layerTreeAsText(), and plumb it
through to GraphicsLayerCA, which dumps the TiledBacking tile coverage rect.

Test: platform/mac/tiled-drawing/use-tiled-drawing.html

* page/Frame.h:
* platform/graphics/GraphicsLayer.cpp:
(showGraphicsLayerTree):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::tiledBacking):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::tiledBacking):
(WebCore::GraphicsLayerCA::dumpAdditionalProperties):
* platform/graphics/ca/GraphicsLayerCA.h:
(GraphicsLayerCA):
* platform/graphics/ca/mac/TileCache.h:
(WebCore::TileCache::tileCoverageRect):
(TileCache):
* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::computeTileCoverageRect):
(WebCore::TileCache::revalidateTiles):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::Internals::layerTreeAsText):
* testing/Internals.h:
* testing/Internals.idl:

Tools:

Make WebKitTestRunner use a WKView with a tile cache for tests run in a directory
whose path includes "tiled-drawing". It does this by passing around a WKDictionary
of options, and if the current PlatformWebView doesn't support those options, it will
create a new one.

* WebKitTestRunner/PlatformWebView.h:
(PlatformWebView): Add a WKDictionaryRef options dictionary argument.
(WTR::PlatformWebView::viewSupportsOptions): Returns true if the view
supports the options in the WKDictionaryRef.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize): Call createWebViewWithOptions() with
no options in the normal case.
(WTR::TestController::createWebViewWithOptions): Moved code into this fuction
so we can call it in two places.
(WTR::TestController::ensureViewSupportsOptions): If the current view
doesn't support the given options, throw it away and makea  new one that does.
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::shouldUseTiledDrawing): Return true if the directory contains "tiled-drawing".
(WTR::updateTiledDrawingForCurrentTest): Tell the TestController to check whether
the view supports the given options. No-op for non-Mac platforms.
(WTR::TestInvocation::invoke): Call updateTiledDrawingForCurrentTest().
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::PlatformWebView): New constructor parameter.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView):  New constructor parameter.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(-[TestRunnerWKView initWithFrame:contextRef:pageGroupRef:useTiledDrawing:]):
(-[TestRunnerWKView _shouldUseTiledDrawingArea]): Subclass the WKView so we can return
a custom value from this method.
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::PlatformWebView::PlatformWebView): New constructor parameter.
* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::PlatformWebView): New constructor parameter.

LayoutTests:

A new test that dumps tile cache data for a large page.

* platform/mac/tiled-drawing/use-tiled-drawing-expected.txt: Added.
* platform/mac/tiled-drawing/use-tiled-drawing.html: Added.

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