Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Issue 66483002: fontSelector should be reset when removing stylesheets which has @font-face rule. (Closed)

Created:
7 years, 1 month ago by tasak
Modified:
7 years, 1 month ago
CC:
blink-reviews, eae+blinkwatch, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears
Visibility:
Public.

Description

fontSelector should be reset when removing stylesheets which has @font-face rule. r159957 changed to avoid destroying StyleResolver when removing stylesheets. However if the removed stylesheets has any @font-face rule, we need to reset not only rulesets, but fontselector. BUG=305885 TEST=fast/css/font-face-remove.html,fast/css/remove-style-after-insert-font-face.html,fast/css/remove-style-after-remove-font-face.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162094

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Patch Set 3 : Patch for landing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+157 lines, -26 lines) Patch
A LayoutTests/fast/css/font-face-remove.html View 1 chunk +23 lines, -0 lines 0 comments Download
A + LayoutTests/fast/css/font-face-remove-expected.html View 1 chunk +6 lines, -1 line 0 comments Download
A LayoutTests/fast/css/remove-style-after-insert-font-face.html View 1 1 chunk +23 lines, -0 lines 0 comments Download
A + LayoutTests/fast/css/remove-style-after-insert-font-face-expected.html View 1 1 chunk +6 lines, -1 line 0 comments Download
A LayoutTests/fast/css/remove-style-after-remove-font-face.html View 1 1 chunk +24 lines, -0 lines 0 comments Download
A + LayoutTests/fast/css/remove-style-after-remove-font-face-expected.html View 1 1 chunk +6 lines, -1 line 0 comments Download
M Source/core/css/CSSParser-in.cpp View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/StyleSheetContents.h View 1 2 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/css/StyleSheetContents.cpp View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M Source/core/dom/DocumentStyleSheetCollection.cpp View 1 3 chunks +8 lines, -7 lines 0 comments Download
M Source/core/dom/ShadowTreeStyleSheetCollection.cpp View 1 2 chunks +5 lines, -8 lines 0 comments Download
M Source/core/dom/StyleSheetCollection.h View 1 1 chunk +13 lines, -2 lines 0 comments Download
M Source/core/dom/StyleSheetCollection.cpp View 1 2 4 chunks +23 lines, -6 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
tasak
@viewport has almost the same issue, but the issue will be fixed by: https://codereview.chromium.org/42543007
7 years, 1 month ago (2013-11-08 10:15:37 UTC) #1
tasak
7 years, 1 month ago (2013-11-08 10:18:16 UTC) #2
dglazkov
lgtm with comments. https://codereview.chromium.org/66483002/diff/1/Source/core/dom/StyleSheetCollection.cpp File Source/core/dom/StyleSheetCollection.cpp (right): https://codereview.chromium.org/66483002/diff/1/Source/core/dom/StyleSheetCollection.cpp#newcode182 Source/core/dom/StyleSheetCollection.cpp:182: requiresResetFontSelector = updateType != Additive ? ...
7 years, 1 month ago (2013-11-08 18:05:33 UTC) #3
tasak
Thank you for reviewing. I added two more layout tests covering 2 cases: inserting @font-face ...
7 years, 1 month ago (2013-11-12 04:13:10 UTC) #4
dglazkov
lgtm++
7 years, 1 month ago (2013-11-12 04:43:00 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tasak@google.com/66483002/260001
7 years, 1 month ago (2013-11-15 08:12:34 UTC) #6
commit-bot: I haz the power
Change committed as 162094
7 years, 1 month ago (2013-11-15 09:42:53 UTC) #7
ojan
I think we have the same problem if you remove a stylesheet that has a ...
7 years, 1 month ago (2013-11-15 21:13:50 UTC) #8
tasak
7 years, 1 month ago (2013-11-18 11:17:58 UTC) #9
Message was sent while issue was closed.
On 2013/11/15 21:13:50, ojan wrote:
> I think we have the same problem if you remove a stylesheet that has a
> viewport-dependent media queries or treeBoundaryCrossingRules, no?

StyleSheetCollection::resetAllRuleSetsInTreeScope should cover. (If not, it's a
bug. Need to fix)

When removing a stylesheet, resetAllRuleSetsInTreeScope will be invoked.

treeBoundaryCrossingRules will be reset in StyleResolver::resetAuthorStyle
invoked from StyleSheetCollection::resetAllRuleSetsInTreeScope.

Since @viewport rules are stored in normal RuleSet,
StyleResolver::resetAuthorStyle also reset viewports.

And after appending all authorstyles,
i.e.StyleResolver::finishAppendAuthorStyleSheets, viewport-dependent description
will be updated.

Talking about @font-face rules, there still exists a bug. I created a patch for
fixing the bug, i.e. https://codereview.chromium.org/73993002
in_reply_to:
ahdzfmNocm9taXVtY29kZXJldmlldy1ocnIdCxIFSXNzdWUYuubZHwwLEgdNZXNzYWdlGKHRGQw
send_mail: 1
subject: fontSelector should be reset when removing stylesheets which has
@font-face rule.

Powered by Google App Engine
This is Rietveld 408576698