Closed Bug 650499 Opened 9 years ago Closed 9 years ago

"ASSERTION: Invalid offset" with soft hyphen, white-space:pre

Categories

(Core :: Layout: Text and Fonts, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: jfkthame)

References

(Blocks 2 open bugs)

Details

(Keywords: assertion, testcase)

Attachments

(4 files)

Attached file testcase
###!!! ASSERTION: Invalid offset: 'aOffset <= mSkipChars->mCharCount', file gfx/thebes/gfxSkipChars.cpp, line 92
Attached file stack trace
Looks like more fallout from bug 418975 and its followup fixes (sigh).
Blocks: 418975
It looks like the problem here arises because the presence of the preformatted newline in the text node means that the textrun ends up "truncated" at that point, so it doesn't cover all the text that the code was expecting it to.

To handle this case, we can set len for the PropertyProvider to the minimum of the actual content length and the length covered by the textrun.
Attachment #526712 - Flags: review?(roc)
Attachment #526714 - Flags: review?(roc)
http://hg.mozilla.org/mozilla-central/rev/dc4b44f3e3f7 (patch)
http://hg.mozilla.org/mozilla-central/rev/b17d5f8022af (testcase)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Comment on attachment 526712 [details] [diff] [review]
patch, limit length for PropertyProvider to what's actually in the textrun

>+    len = PR_MIN(GetContentOffset() + GetInFlowContentLength(),
>+                 tmp.ConvertSkippedToOriginal(flowEndInTextRun)) - iter.GetOriginalOffset();

This really should have been NS_MIN.
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.