WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
43457
Make the cascade level of "user" styles configurable
https://bugs.webkit.org/show_bug.cgi?id=43457
Summary
Make the cascade level of "user" styles configurable
Aaron Boodman
Reported
2010-08-03 19:11:09 PDT
Chromium needs to set the cascade level to "author" for backward compatibility.
Attachments
Patch
(9.77 KB, patch)
2010-08-04 10:30 PDT
,
Aaron Boodman
no flags
Details
Formatted Diff
Diff
Patch
(10.90 KB, patch)
2010-08-04 12:41 PDT
,
Aaron Boodman
no flags
Details
Formatted Diff
Diff
Patch
(10.96 KB, patch)
2010-08-10 16:58 PDT
,
Aaron Boodman
no flags
Details
Formatted Diff
Diff
Patch
(10.77 KB, patch)
2010-08-11 18:33 PDT
,
Aaron Boodman
hyatt
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Aaron Boodman
Comment 1
2010-08-04 10:30:20 PDT
Created
attachment 63465
[details]
Patch
Eric Seidel (no email)
Comment 2
2010-08-04 10:50:25 PDT
Attachment 63465
[details]
did not build on mac: Build output:
http://queues.webkit.org/results/3580800
Aaron Boodman
Comment 3
2010-08-04 12:41:34 PDT
Created
attachment 63481
[details]
Patch
Dave Hyatt
Comment 4
2010-08-06 14:31:43 PDT
Comment on
attachment 63481
[details]
Patch
> + { > + OwnPtr<CSSRuleSet> tempUserStyle(new CSSRuleSet); > if (pageUserSheet) > - m_userStyle->addRulesFromSheet(pageUserSheet, *m_medium, this); > + tempUserStyle->addRulesFromSheet(pageUserSheet, *m_medium, this); > if (pageGroupUserSheets) { > unsigned length = pageGroupUserSheets->size(); > - for (unsigned i = 0; i < length; i++) > - m_userStyle->addRulesFromSheet(pageGroupUserSheets->at(i).get(), *m_medium, this); > + for (unsigned i = 0; i < length; i++) { > + if (pageGroupUserSheets->at(i)->isUserStyleSheet()) > + tempUserStyle->addRulesFromSheet(pageGroupUserSheets->at(i).get(), *m_medium, this); > + else > + m_authorStyle->addRulesFromSheet(pageGroupUserSheets->at(i).get(), *m_medium, this); > + } > } > + > + if (tempUserStyle->m_ruleCount > 0) > + m_userStyle = tempUserStyle.leakPtr(); > }
Unless I'm misreading this, you have indented code inside braces but no longer have an if statement? Just pull the code out of the braces.
> - parsedSheet->setIsUserStyleSheet(true); > + > + if (sheet->level() == UserStyleSheet::UserLevel) > + parsedSheet->setIsUserStyleSheet(true); > + else { > + ASSERT(sheet->level() == UserStyleSheet::AuthorLevel); > + parsedSheet->setIsUserStyleSheet(false); > + } > +
I wouldn't worry about the assert here... just do: parsedSheet->setIsUserStyleSheet(sheet->level() == UserStyleSheet::UserLevel) More compact.
> OwnPtr<UserStyleSheet> userStyleSheet(new UserStyleSheet(source, url, whitelist, blacklist, injectedFrames)); > + userStyleSheet->setLevel(level);
Just make level part of the constructor, so that you don't have to have a 2nd line with a setLevel call. Everything else looks fine.
Aaron Boodman
Comment 5
2010-08-10 16:58:11 PDT
Created
attachment 64055
[details]
Patch
Dave Hyatt
Comment 6
2010-08-11 11:49:48 PDT
Comment on
attachment 64055
[details]
Patch r-me
Aaron Boodman
Comment 7
2010-08-11 13:38:29 PDT
Committed
r65183
: <
http://trac.webkit.org/changeset/65183
>
WebKit Review Bot
Comment 8
2010-08-11 14:40:57 PDT
http://trac.webkit.org/changeset/65183
might have broken Leopard Intel Release (Tests) The following changes are on the blame list:
http://trac.webkit.org/changeset/65182
http://trac.webkit.org/changeset/65183
Kenneth Russell
Comment 9
2010-08-11 17:35:43 PDT
I think there may have been a merge problem in WebCore/ChangeLog with one of the patches landed for this bug. See
https://bugs.webkit.org/show_bug.cgi?id=40320
and
http://trac.webkit.org/changeset/65193
which it references.
Aaron Boodman
Comment 10
2010-08-11 18:27:40 PDT
Change broke test printing/page-rule-selection.html
Aaron Boodman
Comment 11
2010-08-11 18:33:45 PDT
Created
attachment 64179
[details]
Patch
Aaron Boodman
Comment 12
2010-08-11 18:36:04 PDT
The only change to the patch is the addition of " || tempUserStyle->m_pageRuleCount > 0" to line 479 of CSSStyleSelector.cpp.
Dave Hyatt
Comment 13
2010-08-12 14:25:38 PDT
Comment on
attachment 64179
[details]
Patch r=me
Aaron Boodman
Comment 14
2010-08-12 15:41:23 PDT
Committed
r65273
: <
http://trac.webkit.org/changeset/65273
>
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