Bug 1402476. ExpectedOwnerForChild should not return a first-letter frame for a text child. r=emilio

The expected owner is the DOM parent.  The first-letter then does some reparenting of the text style later.
This commit is contained in:
Boris Zbarsky 2017-10-02 16:36:47 -04:00
parent 18b234fd09
commit 4a228305f6
3 changed files with 20 additions and 0 deletions

View File

@ -84,6 +84,12 @@ ExpectedOwnerForChild(const nsIFrame& aFrame)
return parent->IsLineFrame() ? parent->GetParent() : parent;
}
if (parent->IsLetterFrame()) {
// Things never have ::first-letter as their expected parent. Go
// on up to the ::first-letter's parent.
parent = parent->GetParent();
}
parent = FirstContinuationOrPartOfIBSplit(parent);
// We've handled already anon boxes and bullet frames, so now we're looking at

View File

@ -0,0 +1,13 @@
<html class="reftest-wait">
<script>
a = document.createElement("style")
a.appendChild(document.createTextNode("*:first-letter { }"))
document.documentElement.appendChild(a)
a.style.display = "contents"
requestIdleCallback(() => {
a.appendChild(document.createElement("x"));
a.lastChild.offsetWidth;
document.documentElement.className = "";
})
</script>
</html>

View File

@ -505,3 +505,4 @@ load 1400438-1.html
load 1400599-1.html
load 1401739.html
load 1401840.html
load 1402476.html