CSSStyleDeclaration.getPropertyPriority() fails for CSS shorthand properties with...
authoralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Feb 2012 21:48:23 +0000 (21:48 +0000)
committeralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Feb 2012 21:48:23 +0000 (21:48 +0000)
commita0ad1dc5b54d23bdd64196388efae3681aecae19
treef08b7592bdd2687c81b5d5cb05c58de938ebfffc
parentc29111835be609f26205eabab9aba74596c2b3e9
CSSStyleDeclaration.getPropertyPriority() fails for CSS shorthand properties with 'important' priority
https://bugs.webkit.org/show_bug.cgi?id=49058

Reviewed by Andreas Kling.

Source/WebCore:

CSSMutableStyleDeclaration::getPropertyPriority was not handling shorthands properly. Shorthands are
not part of the property list of the style so we need to query the longhands which are the one added
in the list. Only if the longhands have equal priority the shorthand priority is known. I also renamed
getPropertyPriority (not the CSSOM exposed method) to something more consistent with WebKit naming guidelines.

Test: fast/css/shorthand-priority.html

* css/CSSMutableStyleDeclaration.cpp:
(WebCore::CSSMutableStyleDeclaration::propertyIsImportant):
(WebCore::CSSMutableStyleDeclaration::addParsedProperty):
(WebCore::CSSMutableStyleDeclaration::getPropertyPriority):
* css/CSSMutableStyleDeclaration.h:
(CSSMutableStyleDeclaration):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::extractAndRemoveTextDirection):
(WebCore::EditingStyle::collapseTextDecorationProperties):
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement):
(WebCore::setTextDecorationProperty):
* editing/RemoveCSSPropertyCommand.cpp:
(WebCore::RemoveCSSPropertyCommand::doApply):

Source/WebKit/qt:

Update the code as getPropertyPriority has been renamed to propertyIsImportant.

* Api/qwebelement.cpp:
(QWebElement::styleProperty):

LayoutTests:

* fast/css/shorthand-priority-expected.txt: Added.
* fast/css/shorthand-priority.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/shorthand-priority-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/shorthand-priority.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSMutableStyleDeclaration.cpp
Source/WebCore/css/CSSMutableStyleDeclaration.h
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/RemoveCSSPropertyCommand.cpp
Source/WebKit/qt/Api/qwebelement.cpp
Source/WebKit/qt/ChangeLog