Serialized declaration for background-size/-webkit-mask-size should preserve identical
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jul 2015 20:40:27 +0000 (20:40 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jul 2015 20:40:27 +0000 (20:40 +0000)
commitb98788354e54fb162acd56893aa35a29ff9e8e6c
tree7bf0de5b883535cc2f2b97bb959e60e316fce5bd
parent4601be1a7e37dfc567051c0329d2b773578dd5f9
Serialized declaration for background-size/-webkit-mask-size should preserve identical
values instead of coalescing them
https://bugs.webkit.org/show_bug.cgi?id=143191
<rdar://problem/21759393>

Reviewed by Darin Adler.

Source/WebCore:

Inspired by Blink r157745:
<http://src.chromium.org/viewvc/blink?view=revision&revision=157745>
And Blink r172548:
<http://src.chromium.org/viewvc/blink?view=revision&revision=172548>

Fixes an issue where identical values in a CSS declaration for properties background-size
and -webkit-mask-size would be coalesced when serialized.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseFillSize): Modified to create a Pair object with the appropriate
identical value encoding strategy. We only coalesce identical values when serializing the
declaration of property -webkit-background-size.
* css/Pair.h:
(WebCore::Pair::create): Added variant that takes an encoding.
(WebCore::Pair::cssText): Moved implementation of Pair::generateCSSString() to here and
modified to conditionally coalesce identical values during serialization.
(WebCore::Pair::Pair): Added variant that takes an encoding.
(WebCore::Pair::generateCSSString): Deleted; moved implementation into Pair::cssText().

LayoutTests:

Inspired by Blink r172548:
<http://src.chromium.org/viewvc/blink?view=revision&revision=172548>

Update tests and test results to ensure we serialize background-size, -webkit-mask-size
correctly when identical values are present in their declarations.

* fast/backgrounds/size/parsing-background-size-values-expected.txt:
* fast/backgrounds/size/resources/parsing-background-size-values.js:
* fast/masking/parsing-mask-expected.txt:
* fast/masking/parsing-mask.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt
LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js
LayoutTests/fast/masking/parsing-mask-expected.txt
LayoutTests/fast/masking/parsing-mask.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/Pair.h