WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
60372
[Qt] tst_QWebElement::style() fails because QWebElement::InlineStyle now works as expected
https://bugs.webkit.org/show_bug.cgi?id=60372
Summary
[Qt] tst_QWebElement::style() fails because QWebElement::InlineStyle now work...
Ademar Reis
Reported
2011-05-06 07:34:57 PDT
The QWebElement documentation says that about QWebElement::InlineStyle: "Return the property value as it is defined in the element, without respecting style inheritance and other CSS rules". In our QWebElement test, we do the following: """ ... p.setStyleProperty("color", "green !important"); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("green")); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("green")); p.setStyleProperty("color", "blue"); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); ... """ But the test fails: """ FAIL! : tst_QWebElement::style() Compared values are not the same Actual (p.styleProperty("color", QWebElement::InlineStyle)): green Expected (QLatin1String("blue")): blue Loc: [/opt/projects/webkit/webkit/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp(486)] """ When this was first implemented, the test expectation was wrong and thus the test was passing. Then there was a change in the CSS code that introduced a regression that curiously made our implementation actually work (and the test fail). The test was fixed and right after so was the regression, so now we have a broken test (as it should be). See
Bug 58032
for the whole story.
Attachments
mark failing test case as expected fail
(1.42 KB, patch)
2011-05-20 06:53 PDT
,
Csaba Osztrogonác
no flags
Details
Formatted Diff
Diff
Patch
(2.00 KB, patch)
2012-11-09 08:35 PST
,
Jocelyn Turcotte
hausmann
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Ademar Reis
Comment 1
2011-05-06 11:43:45 PDT
From WebCore::CSSMutableStyleDeclaration::setProperty(): """ // When replacing an existing property value, this moves the property to the end of the list. """ (it also says "Firefox preserves the position, and MSIE moves the property to the beginning", but that's not relevant for this bug) In the testing code, we set the property twice for the same element: p.setStyleProperty("color", "green !important"); ... p.setStyleProperty("color", "blue"); ... So when we call styleProperty(QWebElement::InlineStyle) after the second setStyleProperty(), there are two inline styles and we get the one with high priority. In summary, the implementation is right and the test is wrong, so it's just a matter or reverting the previous "fix".
Ademar Reis
Comment 2
2011-05-06 13:52:15 PDT
Reopening, please ignore my previous round of comments. :-P I'll make sure my patch includes better documentation to avoid more confusion.
Csaba Osztrogonác
Comment 3
2011-05-20 06:53:01 PDT
Created
attachment 94212
[details]
mark failing test case as expected fail
Ademar Reis
Comment 4
2011-05-20 06:56:08 PDT
Comment on
attachment 94212
[details]
mark failing test case as expected fail LGTM. Fixing this will take some more time (time that I don't have at the moment) :(
WebKit Commit Bot
Comment 5
2011-05-20 07:29:28 PDT
Comment on
attachment 94212
[details]
mark failing test case as expected fail Clearing flags on attachment: 94212 Committed
r86953
: <
http://trac.webkit.org/changeset/86953
>
WebKit Commit Bot
Comment 6
2011-05-20 07:29:33 PDT
All reviewed patches have been landed. Closing bug.
Csaba Osztrogonác
Comment 7
2011-05-20 07:30:34 PDT
Reopen to fix it.
Ademar Reis
Comment 8
2011-06-01 12:32:57 PDT
Revision
r86953
cherry-picked into qtwebkit-2.2 with commit b6ea329 <
http://gitorious.org/webkit/qtwebkit/commit/b6ea329
>
Jocelyn Turcotte
Comment 9
2012-11-09 08:32:22 PST
Ademar was right in
comment #1
, a non-important inline style shouldn't be overwritten by a non-important one. So InlineStyle doesn't apply inheritance, but does consider the importance.
Jocelyn Turcotte
Comment 10
2012-11-09 08:35:16 PST
Created
attachment 173313
[details]
Patch Unmark the failure and fix the expected value.
Jocelyn Turcotte
Comment 11
2012-11-12 07:31:15 PST
Committed
r134233
: <
http://trac.webkit.org/changeset/134233
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug