Closed Bug 1376640 Opened 5 years ago Closed 5 years ago

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

Categories

(Core :: CSS Parsing and Computation, enhancement)

53 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

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+
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)
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)
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)
https://hg.mozilla.org/mozilla-central/rev/bf11951d30a6
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.