Backed out 2 changesets (bug 1343695) for osx chrome mochitest assertions a=backout

Backed out changeset e5db40a036fe (bug 1343695)
Backed out changeset 687ffd715113 (bug 1343695)

MozReview-Commit-ID: 2CN1gipg3ia
This commit is contained in:
Wes Kocher 2017-03-13 16:44:23 -07:00
Родитель 8010f266fb
Коммит 33cca3c72a
3 изменённых файлов: 22 добавлений и 29 удалений

Просмотреть файл

@ -2906,6 +2906,13 @@ static nsresult GetPartialTextRect(nsLayoutUtils::RectCallback* aCallback,
{
nsTextFrame* textFrame = GetTextFrameForContent(aContent, aFlushLayout);
if (textFrame) {
// If we'll need it later, collect the full content text now.
nsAutoString textContent;
if (aTextList) {
mozilla::ErrorResult err; // ignored
aContent->GetTextContent(textContent, err);
}
nsIFrame* relativeTo = nsLayoutUtils::GetContainingBlockForClientRect(textFrame);
for (nsTextFrame* f = textFrame; f; f = static_cast<nsTextFrame*>(f->GetNextContinuation())) {
int32_t fstart = f->GetContentOffset(), fend = f->GetContentEnd();
@ -2936,13 +2943,11 @@ static nsresult GetPartialTextRect(nsLayoutUtils::RectCallback* aCallback,
// Finally capture the text, if requested.
if (aTextList) {
nsIFrame::RenderedText renderedText = f->GetRenderedText(
textContentStart,
textContentEnd,
nsIFrame::TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
nsIFrame::TrailingWhitespace::DONT_TRIM_TRAILING_WHITESPACE);
aTextList->AppendElement(renderedText.mString, fallible);
const nsAString& textSubstring =
Substring(textContent,
textContentStart,
(textContentEnd - textContentStart));
aTextList->AppendElement(textSubstring, fallible);
}
}
}

Просмотреть файл

@ -15,17 +15,11 @@ function runTests()
let attempts = [
{startNode: "one", start:0, endNode:"one", end:0, textList:[], message:"Empty rect"},
{startNode: "one", start:2, endNode:"one", end:6, textList:["l on"], message:"Single line"},
{startNode: "implicit", start:6, endNode:"implicit", end:12, textList:["it bre"], message:"Implicit break"},
{startNode: "implicit", start:6, endNode:"implicit", end:12, textList:["it\nbre"], message:"Implicit break"},
{startNode: "two.a", start:1, endNode:"two.b", end:2, textList:["wo", "", "li"], message:"Two lines"},
{startNode: "embed.a", start:7, endNode:"embed.b", end:2, textList:["th ", "simple nested", " ", "te"], message:"Simple nested"},
{startNode: "deep.a", start:2, endNode:"deep.b", end:2, textList:["ne with ", "complex, more deeply nested", " ", "te"], message:"Complex nested"},
{startNode: "image.a", start:7, endNode:"image.b", end:2, textList:["th inline ", "", " ", "im"], message:"Inline image"},
{startNode: "hyphen1", start:0, endNode:"hyphen1", end:3, textList:["a\u00AD", "b"], message:"Shy hyphen (active)"},
{startNode: "hyphen2", start:0, endNode:"hyphen2", end:3, textList:["c\u00ADd"], message:"Shy hyphen (inactive)"},
{startNode: "hyphen2", start:0, endNode:"hyphen2", end:2, textList:["c\u00AD"], message:"Shy hyphen (inactive, trailing)"},
{startNode: "hyphen2", start:1, endNode:"hyphen2", end:3, textList:["\u00ADd"], message:"Shy hyphen (inactive, leading)"},
{startNode: "uc", start:0, endNode:"uc", end:2, textList:["EF"], message:"UC transform"},
{startNode: "pre", start:0, endNode:"pre", end:3, textList:["g\n", "h"], message:"pre with break"},
];
for (let attempt of attempts) {
@ -62,14 +56,5 @@ break in one line</div>
<div id="image.a">Line with inline <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAG0lEQVR42mP8z0A%2BYKJA76jmUc2jmkc1U0EzACKcASfOgGoMAAAAAElFTkSuQmCC" width="20" height="20"/> <span id="image.b">image</span></div>
<div id="hyphen1" style="width:0">a&shy;b</div>
<div id="hyphen2" style="width:100px">c&shy;d</div>
<div id="uc" style="text-transform:uppercase">ef</div>
<pre id="pre">g
h</pre>
</body>
</html>

Просмотреть файл

@ -4018,13 +4018,16 @@ struct MOZ_RAII BoxToRectAndText : public BoxToRect {
if (aFrame->GetType() == nsGkAtoms::textFrame) {
nsTextFrame* textFrame = static_cast<nsTextFrame*>(aFrame);
nsIFrame::RenderedText renderedText = textFrame->GetRenderedText(
textFrame->GetContentOffset(),
textFrame->GetContentOffset() + textFrame->GetContentLength(),
nsIFrame::TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
nsIFrame::TrailingWhitespace::DONT_TRIM_TRAILING_WHITESPACE);
nsIContent* content = textFrame->GetContent();
nsAutoString textContent;
mozilla::ErrorResult err; // ignored
content->GetTextContent(textContent, err);
aResult.Append(renderedText.mString);
const nsAString& textSubstring =
Substring(textContent,
textFrame->GetContentOffset(),
textFrame->GetContentLength());
aResult.Append(textSubstring);
}
for (nsIFrame* child = aFrame->PrincipalChildList().FirstChild();