Remove the (dead) code for handling shorthands in StyleResolver / StyleBuilder
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 13:31:17 +0000 (13:31 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 13:31:17 +0000 (13:31 +0000)
commitd3eae28a11822b31c3cced4e094b6b4ac3f3adf2
tree6e1361407a0a00d2386f1e853a51737892f3063c
parentf670906bddb9c1795b4575d6d68a6287b9a2df50
Remove the (dead) code for handling shorthands in StyleResolver / StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=111505

Reviewed by Alexis Menard.

The CSS parsing code expands shorthands (with the exception of 'font') to their longhands.
This means that all the code in StyleResolver / StyleBuilder to handle shorthands is basically
dead and shouldn't be there. The reason for it to be is that people didn't know about shorthands
expansion and thus copied existing code.

This change addresses both issues by removing the code and adding ASSERTs that should prevent people
from adding more dead code.

Refactoring, covered by existing tests.

* css/StylePropertyShorthand.h: Added isExpandedShorthand.
* css/StylePropertyShorthand.cpp:
(WebCore::isExpandedShorthand):
Added this function that ignores 'font' as it is the only shorthand that is no consistently expanded
to account for system fonts.

* css/StyleBuilder.cpp:
(WebCore::StyleBuilder::StyleBuilder):
Removed the shorthands.

* css/StyleBuilder.h:
(WebCore::StyleBuilder::setPropertyHandler):
Added ASSERTs that people don't add shorthand handling.

* css/StyleResolver.cpp:
(WebCore::isValidVisitedLinkProperty):
Removed all the shorthands (shouldn't be reachable unless the ASSERT in applyProperty
triggers).

(WebCore::StyleResolver::applyProperty):
Removed all shorthand handling code, moved the shorthands together and added some ASSERT
to ensure people don't abuse the code and re-add some of it back by mistake.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/StyleBuilder.cpp
Source/WebCore/css/StyleBuilder.h
Source/WebCore/css/StylePropertyShorthand.cpp
Source/WebCore/css/StylePropertyShorthand.h
Source/WebCore/css/StyleResolver.cpp