Bug 841174 - Handle ::first-letter on a combining mark in SVG text without crashing. r=jwatt

--HG--
extra : rebase_source : 9b0b38eccfe1f355996d8e4b4be5dcfc4e00b3be
This commit is contained in:
Cameron McCormack 2013-02-14 21:31:32 +11:00
parent aa30282f1e
commit 02273bad6d
4 changed files with 22 additions and 5 deletions

View File

@ -0,0 +1,7 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="200">
<text x="100" y="100" style="font: 16px sans-serif">&#x0301;t</text>
</svg>

After

Width:  |  Height:  |  Size: 262 B

View File

@ -0,0 +1,10 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="200">
<style>
text::first-letter { font-size: 32px }
</style>
<text x="100" y="100" style="font: 16px sans-serif">&#x0301;t</text>
</svg>

After

Width:  |  Height:  |  Size: 326 B

View File

@ -134,6 +134,7 @@ HTTP(../..) == simple-transform-rotate.svg simple-transform-rotate-ref.svg
== pseudo-first-line.svg pseudo-first-line-ref.svg
== pseudo-first-line-2.svg pseudo-first-line-2-ref.svg
== pseudo-first-letter.svg pseudo-first-letter-ref.svg
== pseudo-first-letter-2.svg pseudo-first-letter-2-ref.svg
== ignore-before-after.svg ignore-prop-ref.svg
# invalid child nodes

View File

@ -273,11 +273,7 @@ IsNonEmptyTextFrame(nsIFrame* aFrame)
return false;
}
nsIContent* content = textFrame->GetContent();
NS_ASSERTION(content && content->IsNodeOfType(nsINode::eTEXT),
"unexpected content type for nsTextFrame");
return static_cast<nsTextNode*>(content)->TextLength() != 0;
return textFrame->GetContentLength() != 0;
}
/**
@ -1440,6 +1436,9 @@ TextNodeCorrespondenceRecorder::TraverseAndRecord(nsIFrame* aFrame)
* * what nsInlineFrame corresponding to a <textPath> element it is a
* descendant of
* * what computed dominant-baseline value applies to it
*
* Note that any text frames that are empty -- whose ContentLength() is 0 --
* will be skipped over.
*/
class TextFrameIterator
{