cssText should use shorthand notations
https://bugs.webkit.org/show_bug.cgi?id=81737
Reviewed by Enrica Casucci.
Source/JavaScriptCore:
Export symbols of BitVector on Windows.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
Source/WebCore:
Use shorthand properties to serialize style properties for cssText.
The overall algorithm is to look for any property that has a shorthand, and then check if
the shorthand value could be obtained (the condition is quite complicated for border properties).
If it could, then append that value to the string builder, and set the corresponding entries in
shorthandPropertyAppeared and shorthandPropertyUsed. If not, only turn on the bit in
shorthandPropertyAppeared on to avoid calling getPropertyValue again for longhand properties
that use the same shorthand property when we cannot use the shorthand.
Test: fast/css/cssText-shorthand.html
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::asText):
Source/WTF:
* wtf/BitVector.h:
(BitVector):
(WTF::BitVector::ensureSizeAndSet): Added.
LayoutTests:
Rebaseline existing tests and add a regression test for unprefixed CSS properties with
the exception of -webkit-border-horizontal/vertical-spacing (the shorthand version of
these properties (border-spacing) is unprefixed.
* editing/pasteboard/paste-and-sanitize-expected.txt: Uses border instead of longhand
properties as desired.
* editing/pasteboard/paste-and-sanitize.html:
* editing/style/non-inheritable-styles-expected.txt: Ditto.
* fast/css/background-position-serialize-expected.txt: No longer emits "background-*:
initial" as desired.
* fast/css/cssText-shorthand-expected.txt: Added.
* fast/css/cssText-shorthand.html: Added.
* fast/css/remove-shorthand-expected.txt:
* fast/css/remove-shorthand.html: Modified to do elaborative comparison of the lists of
properties before and after removing a shorthand since now removing a shorthand property
may end up adding new longhand property.
* fast/css/uri-token-parsing-expected.txt:
* fast/css/uri-token-parsing.html: Uses shorthand properties instead of longhand equivalents.
* inspector/styles/styles-update-from-js-expected.txt: Ditto.
* printing/page-rule-css-text-expected.txt: Ditto.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112177
268f45cc-cd09-0410-ab3c-
d52691b4dbfc