Closed
Bug 1229278
Opened 9 years ago
Closed 9 years ago
Dynamic changes to text-emphasis may not take effect
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: xidorn, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
If script changes text-emphasis-style or text-emphasis-position dynamically, the new value may not take effect until next reflow.
The emphasis marks info is currently updated in nsTextFrame::UnionAdditionalOverflow, which is called by nsTextFrame::ReflowText and nsTextFrame::RecomputeOverflow. And we return nsChangeHint_UpdateOverflow for those changes which I supposed should triggers RecomputeOverflow somehow. So it isn't quite clear what's the reason of this issue. Probably I misunderstood the meaning of UpdateOverflow.
Dynamic changes to text-emphasis-position will be fixed in bug 1225018 because changing to that property would always triggers reflow since that bug. But text-emphasis-style won't be fixed there.
Comment 1•9 years ago
|
||
RecomputeOverflow is a specific thing that happens during inline reflow, because we can't determine the overflow of a text frame until the entire line has been laid out.
UpdateOverflow is a general mechanism that works on all frames, that is designed to be used for certain style changes that change overflow but don't require reflow.
nsTextFrame has a RecomputeOverflow method and an UpdateOverflow method. (We should probably add some comments pointing from one to the other, explaining this difference.)
Comment 2•9 years ago
|
||
(Also, since nsChangeHint_UpdateOverflow is a change hint that doesn't imply the handling of the change for all descendants, we can't use the UpdateOverflow hint for inherited properties, which means that we should never actually call UpdateOverflow on text frames... at least not from style change handling.)
Reporter | ||
Comment 3•9 years ago
|
||
(In reply to David Baron [:dbaron] ⌚UTC-8 from comment #2)
> (Also, since nsChangeHint_UpdateOverflow is a change hint that doesn't imply
> the handling of the change for all descendants, we can't use the
> UpdateOverflow hint for inherited properties, which means that we should
> never actually call UpdateOverflow on text frames... at least not from style
> change handling.)
But text frames should inherit those properties from their ancestors, and get CalcDifference called on style struct of themselves, no? There is a UpdateSubtreeOverflow hint, but I suppose that is only for things like text decorarion which isn't inherited but does affect descendents.
Reporter | ||
Comment 4•9 years ago
|
||
(In reply to David Baron [:dbaron] ⌚UTC-8 from comment #1)
> RecomputeOverflow is a specific thing that happens during inline reflow,
> because we can't determine the overflow of a text frame until the entire
> line has been laid out.
>
> UpdateOverflow is a general mechanism that works on all frames, that is
> designed to be used for certain style changes that change overflow but don't
> require reflow.
>
> nsTextFrame has a RecomputeOverflow method and an UpdateOverflow method.
> (We should probably add some comments pointing from one to the other,
> explaining this difference.)
Yeah, I think I checked nsTextFrame::UpdateOverflow method, and confirmed it does call RecomputeOverflow. I just checked that function again, now I guess this issue is because that function returns earlier because no decoration block is found.
Comment 5•9 years ago
|
||
(In reply to Xidorn Quan [:xidorn] (UTC+10) from comment #3)
> But text frames should inherit those properties from their ancestors, and
> get CalcDifference called on style struct of themselves, no? There is a
> UpdateSubtreeOverflow hint, but I suppose that is only for things like text
> decorarion which isn't inherited but does affect descendents.
Right, the UpdateSubtreeOverflow hint would lead to calling UpdateOverflow on nsTextFrames.
(We shouldn't use either hint for an inherited property, and I think we have assertions to check that, and text frames can't inherit non-inherited properties since they don't have any specified style.)
Reporter | ||
Comment 6•9 years ago
|
||
I believe at least text-shadow does UpdateSubtreeOverflow. text-emphasis should just follow the same way I suppose.
Reporter | ||
Comment 7•9 years ago
|
||
Bug 1229278 - Fix dynamic changes to text-emphasis-style.
Attachment #8694170 -
Flags: review?(dbaron)
Comment 8•9 years ago
|
||
Comment on attachment 8694170 [details]
MozReview Request: Bug 1229278 - Fix dynamic changes to text-emphasis-style.
https://reviewboard.mozilla.org/r/26681/#review24205
Attachment #8694170 -
Flags: review?(dbaron) → review+
Reporter | ||
Comment 9•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/0ab2f68aa0e2bbae1871e1a6f421ba0e8b8a076c
Bug 1229278 - Fix dynamic changes to text-emphasis-style. r=dbaron
Reporter | ||
Comment 10•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/835de4b7bcb2b9016ef425db25878929c28a9448
Backed out 8 changesets (bug 1225018, bug 1229278, bug 1224013) for reftest failures on CLOSED TREE
Reporter | ||
Comment 11•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/67aea49920bc30e931b0f27fbdffc88218d32265
Bug 1229278 - Fix dynamic changes to text-emphasis-style. r=dbaron
Comment 12•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•