[CSS Font Loading] Switch to dispatching events asynchronously
https://bugs.webkit.org/show_bug.cgi?id=138755

Patch by Bear Travis <betravis@gmail.com> on 2014-11-21
Reviewed by Simon Fraser.

Source/WebCore:

Moving FontLoader to dispatch events and notify callbacks similarly
to EventSender or the GenericEventQueue. Several bugs have popped
up in the past because FontLoader has been sending events during
layout, and there is no need for that to be the case.

Covered by existing font loader event tests. Added an additional
test for the svg case, fontloader-svg-select.

* css/FontLoader.cpp:
(WebCore::FontLoader::didLayout):
(WebCore::FontLoader::timerFired): Adding asynchronous callback.
(WebCore::FontLoader::scheduleEvent): Add an event to the dispatch
queue.
(WebCore::FontLoader::firePendingEvents): Modified to handle the
loading done event and callbacks.
(WebCore::FontLoader::loadingDone): Modified to spin up the timer
rather than immediately dispatching events.
* css/FontLoader.h:

LayoutTests:

Refactoring tests to check for all events only after the FontLoader
itself has completed. Tests were previously checking after a specific font
had loaded, at which point some of the events may have yet to fire.

* fast/css/fontloader-multiple-faces-download-error-expected.txt:
* fast/css/fontloader-multiple-faces-download-error.html:
* fast/css/fontloader-multiple-faces-expected.txt:
* fast/css/fontloader-multiple-faces.html:
* fast/css/fontloader-multiple-families-expected.txt:
* fast/css/fontloader-multiple-families.html:
* fast/css/fontloader-svg-select-expected.txt: Added
* fast/css/fontloader-svg-select.svg: Added

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash when setting 'font' CSS property to 'calc(2 * 3)'
https://bugs.webkit.org/show_bug.cgi?id=138933

Reviewed by Darin Adler.

Source/WebCore:

The CSS Parser was not handling calculated values when parsing the font
weight. This would lead us to hit an assertion when parsing a font
property whose weight is set to a calculated value.

This patch updates parseFontWeight() to properly handle calculated
values.

Test: fast/css/font-calculated-value.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseFontWeight):

LayoutTests:

Add a layout test to cover the case where the 'font' CSS property is
set to a value whose weight is a calculated value, to make sure it
does not crash and behaves as intended.

* fast/css/font-calculated-value-expected.txt: Added.
* fast/css/font-calculated-value.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression(r175381): -webkit-mask-box-image is broken
https://bugs.webkit.org/show_bug.cgi?id=138969
<rdar://problem/19054471>

Reviewed by Simon Fraser.

Source/WebCore:

After r175381, the StyleBuilder would call NinePieceImage::setMaskDefaults()
*after* calling CSSToStyleMap::mapNinePieceImage(), instead of *before*, for
-webkit-mask-box-image CSS property. This was causing the mask defaults to
overwrite what was set by mapNinePieceImage().

Test: fast/css/webkit-mask-box-image.html

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertBorderMask):

LayoutTests:

Add a layout test to add basic coverage for -webkit-mask-box-image
CSS property.

* fast/css/resources/mask.png: Added.
* fast/css/webkit-mask-box-image.html: Added.
* fast/css/webkit-mask-box-image-expected.html: Added


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Two WebGL tests try to use an external resource.
https://bugs.webkit.org/show_bug.cgi?id=138936.
Reviewed by Alexey Proskuryakov.
* http/tests/resources/square128.png: Added.
* http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/more/functions/texImage2DHTML.html:
* http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/more/functions/texSubImage2DHTML.html:
* http/tests/webgl/1.0.2/texImage2DHTML-expected.txt:
* http/tests/webgl/1.0.2/texSubImage2DHTML-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix iOS build.

* Shared/ios/QuickLookDocumentData.cpp:
(WebKit::QuickLookDocumentData::encode):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash when setting 'transition-delay' CSS property to a calculated value
https://bugs.webkit.org/show_bug.cgi?id=138784

Reviewed by Sam Weinig.

Source/WebCore:

Update CSSPrimitiveValue::computeTime() to use primitiveType() instead
of m_primitiveUnitType so that it properly handles calculated values.
Without this, we would hit the ASSERT_NOT_REACHED() assertion in
computeTime() for calculated values.

Test: fast/css/transition-delay-calculated-value.html

* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::computeTime):

LayoutTests:

Add a layout test to check that setting the 'transition-delay' CSS
property to a calculated value does not crash and works as intended.

* fast/css/transition-delay-calculated-value-expected.txt: Added.
* fast/css/transition-delay-calculated-value.html: Added.


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