mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1226293. Followup: add SVG tests. r=bz
This commit is contained in:
parent
8b764d54fa
commit
b62f07f5e0
@ -3334,8 +3334,7 @@ nsGenericHTMLElement::GetInnerText(mozilla::dom::DOMString& aValue,
|
||||
{
|
||||
if (!GetPrimaryFrame(Flush_Layout)) {
|
||||
nsIPresShell* presShell = nsComputedDOMStyle::GetPresShellForContent(this);
|
||||
if (!presShell || !IsInComposedDoc() ||
|
||||
IsOrHasAncestorWithDisplayNone(this, presShell)) {
|
||||
if (!presShell || IsOrHasAncestorWithDisplayNone(this, presShell)) {
|
||||
GetTextContentInternal(aValue, aError);
|
||||
return;
|
||||
}
|
||||
|
@ -73,6 +73,9 @@ testText("<div style='display:none'>abc def", "abc def", "No whitespace compre
|
||||
testText("<div style='display:none'> abc def ", " abc def ", "No removal of leading/trailing whitespace in display:none container");
|
||||
testText("<div>123<span style='display:none'>abc", "123", "display:none child not rendered");
|
||||
testText("<div style='display:none'><span id='target'>abc", "abc", "display:none container with non-display-none target child");
|
||||
testTextInSVG("<div id='target'>abc", "", "non-display-none child of svg");
|
||||
testTextInSVG("<div style='display:none' id='target'>abc", "abc", "display:none child of svg");
|
||||
testTextInSVG("<div style='display:none'><div id='target'>abc", "abc", "child of display:none child of svg");
|
||||
|
||||
/**** display:contents ****/
|
||||
|
||||
|
@ -13,13 +13,25 @@
|
||||
.first-letter-float::first-letter { float:left; }
|
||||
</style>
|
||||
<div id="container"></div>
|
||||
<svg id="svgContainer"></svg>
|
||||
<script>
|
||||
function testText(html, expectedPlain, msg) {
|
||||
textTextInContainer(container, html, expectedPlain, msg);
|
||||
}
|
||||
function testTextInSVG(html, expectedPlain, msg) {
|
||||
textTextInContainer(svgContainer, html, expectedPlain, msg);
|
||||
}
|
||||
function textTextInContainer(cont, html, expectedPlain, msg) {
|
||||
test(function() {
|
||||
container.innerHTML = html;
|
||||
if (cont != container) {
|
||||
while (container.firstChild) {
|
||||
cont.appendChild(container.firstChild);
|
||||
}
|
||||
}
|
||||
var e = document.getElementById('target');
|
||||
if (!e) {
|
||||
e = container.firstChild;
|
||||
e = cont.firstChild;
|
||||
}
|
||||
var pokes = document.getElementsByClassName('poke');
|
||||
for (var i = 0; i < pokes.length; ++i) {
|
||||
@ -40,6 +52,7 @@ function testText(html, expectedPlain, msg) {
|
||||
e = e.nextSibling;
|
||||
}
|
||||
assert_equals(e.innerText, expectedPlain);
|
||||
cont.textContent = '';
|
||||
}, msg);
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user