stylo: first-letter dynamic changes are still not quite right

RESOLVED FIXED in Firefox 56

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Tracking

(Blocks 1 bug)

53 Branch
mozilla56
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(1 attachment)

Testcase:

    <!DOCTYPE html>
    <style>
      span.x { color: green; }
      div::first-letter { font-size: 100px; }
    </style>
    <div style="color: red">
      <span>C</span>
    </div>
    <script>
      onload = function() {
        setTimeout(function() {
          document.body.offsetWidth;
          document.querySelector("span").className = 'x'
        }, 500);
      };
    </script>
    
The problem is that the first-letter should be restyled from the <div> but we're restyling from the <span>.
Attachment #8881675 - Flags: review?(cam) → review+

Comment 2

2 years ago
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2992d5af6251
Fix dynamic updates when an inline that sits between a first-letter and its block changes style.  r=heycam
sorry Boris, had to back this out for causing assertion failures like https://treeherder.mozilla.org/logviewer.html#?job_id=110663297&repo=autoland
Flags: needinfo?(bzbarsky)

Comment 4

2 years ago
Backout by cbook@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fa87c2519486
Backed out changeset 2992d5af6251 for assertion failures like  Assertion failure: mOwner == ExpectedOwnerForChild(aFrame) (Missed some frame in the hierarchy?)
Hmm.  This was green on try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e5d1192b260e40053ab6c0f5c7cbbe606046595d

I guess that assert got added between then and now.  :(
Ah, I expect the problem is that ExpectedOwnerForChild looks for the blockframe when aFrame is a first-letter frame, but the changes in this bug make us restyle the first-letter when restyling its parent (which might be an inline inside the blockframe).

Emilio, should that chunk of ExpectedOwnerForChild just get changed accordingly, or is there a reason it's looking for the block?
Flags: needinfo?(bzbarsky) → needinfo?(emilio+bugs)
Flags: needinfo?(bzbarsky)
Changing it to just look at the parent frame it's fine. The point of those assertions is to be aware of such changes to ensure nothing dumb starts happening. r=me on changing it to just return the parent frame.
Flags: needinfo?(emilio+bugs)

Comment 8

2 years ago
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bf11951d30a6
Fix dynamic updates when an inline that sits between a first-letter and its block changes style.  r=heycam
Flags: needinfo?(bzbarsky)

Comment 9

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/bf11951d30a6
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.