mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-24 19:37:15 +00:00
Bug 1579186 - element.innerText should work with SVG text and foreignObject text r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D80376
This commit is contained in:
parent
a46d965994
commit
f88e9107e1
@ -3049,13 +3049,15 @@ struct InnerTextAccumulator {
|
||||
};
|
||||
|
||||
static bool IsVisibleAndNotInReplacedElement(nsIFrame* aFrame) {
|
||||
if (!aFrame || !aFrame->StyleVisibility()->IsVisible()) {
|
||||
if (!aFrame || !aFrame->StyleVisibility()->IsVisible() ||
|
||||
aFrame->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) {
|
||||
return false;
|
||||
}
|
||||
for (nsIFrame* f = aFrame->GetParent(); f; f = f->GetParent()) {
|
||||
if (f->IsFrameOfType(nsIFrame::eReplaced) &&
|
||||
!f->GetContent()->IsHTMLElement(nsGkAtoms::button) &&
|
||||
!f->GetContent()->IsHTMLElement(nsGkAtoms::select)) {
|
||||
!f->GetContent()->IsAnyOfHTMLElements(nsGkAtoms::button,
|
||||
nsGkAtoms::select) &&
|
||||
!f->GetContent()->IsSVGElement()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -175,6 +175,10 @@ testText("<canvas>abc", "", "<canvas> contents ignored");
|
||||
testText("<canvas><div id='target'>abc", "abc", "<canvas><div id='target'> contents ok for element not being rendered");
|
||||
testText("<img alt='abc'>", "", "<img> alt text ignored");
|
||||
testText("<img src='about:blank' class='poke'>", "", "<img> contents ignored");
|
||||
testText("<div><svg><text>abc</text></svg></div>", "abc", "<svg> text contents preserved");
|
||||
testText("<div><svg><defs><text>abc</text></defs></svg></div>", "", "<svg><defs> text contents ignored");
|
||||
testText("<div><svg><stop>abc</stop></svg></div>", "", "<svg> non-rendered text ignored");
|
||||
testText("<svg><foreignObject><span id='target'>abc</span></foreignObject></svg>", "abc", "<foreignObject> contents preserved");
|
||||
|
||||
/**** <select>, <optgroup> & <option> ****/
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user