зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ee243422ed36 (bug 1413619) for test failures.
This commit is contained in:
Родитель
3c38110bd3
Коммит
a090aa11cd
|
@ -6897,8 +6897,8 @@ nsCSSFrameConstructor::FindFrameForContentSibling(nsIContent* aContent,
|
|||
}
|
||||
if (!sibling) {
|
||||
// ... then ::after / ::before on the opposite end.
|
||||
sibling = aPrevSibling ? nsLayoutUtils::GetBeforeFrame(aContent)
|
||||
: nsLayoutUtils::GetAfterFrame(aContent);
|
||||
sibling = aPrevSibling ? nsLayoutUtils::GetAfterFrame(aContent)
|
||||
: nsLayoutUtils::GetBeforeFrame(aContent);
|
||||
}
|
||||
if (!sibling) {
|
||||
return nullptr;
|
||||
|
@ -8344,7 +8344,9 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
|
|||
// parent has a :before pseudo-element
|
||||
nsIFrame* firstChild = insertion.mParentFrame->PrincipalChildList().FirstChild();
|
||||
|
||||
if (firstChild && firstChild == nsLayoutUtils::GetBeforeFrame(container)) {
|
||||
if (firstChild &&
|
||||
nsLayoutUtils::IsGeneratedContentFor(container, firstChild,
|
||||
nsCSSPseudoElements::before)) {
|
||||
// Insert the new frames after the last continuation of the :before
|
||||
prevSibling = firstChild->GetTailContinuation();
|
||||
insertion.mParentFrame = prevSibling->GetParent()->GetContentInsertionFrame();
|
||||
|
|
|
@ -1734,6 +1734,33 @@ nsLayoutUtils::GetFloatFromPlaceholder(nsIFrame* aFrame) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// static
|
||||
bool
|
||||
nsLayoutUtils::IsGeneratedContentFor(nsIContent* aContent,
|
||||
nsIFrame* aFrame,
|
||||
nsAtom* aPseudoElement)
|
||||
{
|
||||
NS_PRECONDITION(aFrame, "Must have a frame");
|
||||
NS_PRECONDITION(aPseudoElement, "Must have a pseudo name");
|
||||
|
||||
if (!aFrame->IsGeneratedContentFrame()) {
|
||||
return false;
|
||||
}
|
||||
nsIFrame* parent = aFrame->GetParent();
|
||||
NS_ASSERTION(parent, "Generated content can't be root frame");
|
||||
if (parent->IsGeneratedContentFrame()) {
|
||||
// Not the root of the generated content
|
||||
return false;
|
||||
}
|
||||
|
||||
if (aContent && parent->GetContent() != aContent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (aFrame->GetContent()->NodeInfo()->NameAtom() == nsGkAtoms::mozgeneratedcontentbefore) ==
|
||||
(aPseudoElement == nsCSSPseudoElements::before);
|
||||
}
|
||||
|
||||
// static
|
||||
nsIFrame*
|
||||
nsLayoutUtils::GetCrossDocParentFrame(const nsIFrame* aFrame,
|
||||
|
|
|
@ -394,6 +394,23 @@ public:
|
|||
*/
|
||||
static nsIFrame* GetRealPrimaryFrameFor(const nsIContent* aContent);
|
||||
|
||||
/**
|
||||
* IsGeneratedContentFor returns true if aFrame is the outermost
|
||||
* frame for generated content of type aPseudoElement for aContent.
|
||||
* aFrame *might not* have the aPseudoElement pseudo-style! For example
|
||||
* it might be a table wrapper frame and the inner table frame might
|
||||
* have the pseudo-style.
|
||||
*
|
||||
* @param aContent the content node we're looking at. If this is
|
||||
* null, then we just assume that aFrame has the right content
|
||||
* pointer.
|
||||
* @param aFrame the frame we're looking at
|
||||
* @param aPseudoElement the pseudo type we're interested in
|
||||
* @return whether aFrame is the generated aPseudoElement frame for aContent
|
||||
*/
|
||||
static bool IsGeneratedContentFor(nsIContent* aContent, nsIFrame* aFrame,
|
||||
nsAtom* aPseudoElement);
|
||||
|
||||
#ifdef DEBUG
|
||||
// TODO: remove, see bug 598468.
|
||||
static bool gPreventAssertInCompareTreePosition;
|
||||
|
|
|
@ -246,7 +246,7 @@ asserts(0-10) == grid-fragmentation-015.html grid-fragmentation-015-ref.html # b
|
|||
== grid-fragmentation-dyn5-019.html grid-fragmentation-019-ref.html
|
||||
== grid-fragmentation-dyn1-020.html grid-fragmentation-020-ref.html
|
||||
== grid-fragmentation-dyn2-020.html grid-fragmentation-020-ref.html
|
||||
== grid-fragmentation-dyn1-021.html grid-fragmentation-021-ref.html
|
||||
!= grid-fragmentation-dyn1-021.html grid-fragmentation-021-ref.html # bug 1251799
|
||||
== grid-fragmentation-dyn2-021.html grid-fragmentation-021-ref.html
|
||||
== grid-fragmentation-dyn3-021.html grid-fragmentation-021-ref.html
|
||||
== grid-fragmentation-dyn4-021.html grid-fragmentation-021-ref.html
|
||||
|
|
|
@ -104169,18 +104169,6 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"css/css-display-3/display-contents-dynamic-pseudo-insertion-001.html": [
|
||||
[
|
||||
"/css/css-display-3/display-contents-dynamic-pseudo-insertion-001.html",
|
||||
[
|
||||
[
|
||||
"/css/css-display-3/display-contents-dynamic-pseudo-insertion-001-ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/css-display-3/display-contents-dynamic-table-001-inline.html": [
|
||||
[
|
||||
"/css/css-display-3/display-contents-dynamic-table-001-inline.html",
|
||||
|
@ -229656,11 +229644,6 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"css/css-display-3/display-contents-dynamic-pseudo-insertion-001-ref.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/css-display-3/display-contents-flex-001-ref.html": [
|
||||
[
|
||||
{}
|
||||
|
@ -480816,14 +480799,6 @@
|
|||
"4fe143c25be9ecc08e58428f0c588f72c5cb8a3f",
|
||||
"reftest"
|
||||
],
|
||||
"css/css-display-3/display-contents-dynamic-pseudo-insertion-001-ref.html": [
|
||||
"af3b16fc8d05be3ab16d65a2f668233668a23583",
|
||||
"support"
|
||||
],
|
||||
"css/css-display-3/display-contents-dynamic-pseudo-insertion-001.html": [
|
||||
"5e4cf6cea58dd4bf8dfd176e8ec8457e790681c5",
|
||||
"reftest"
|
||||
],
|
||||
"css/css-display-3/display-contents-dynamic-table-001-inline.html": [
|
||||
"5c105a711c083e61eefc4121c707d3ca2ffda3ec",
|
||||
"reftest"
|
||||
|
@ -586581,7 +586556,7 @@
|
|||
"wdspec"
|
||||
],
|
||||
"webdriver/tests/cookies/get_named_cookie.py": [
|
||||
"9455d1504590154ad2a540f102455baff602aefb",
|
||||
"5a4a7cb34740326fe11fb616f741759eeb0952cb",
|
||||
"wdspec"
|
||||
],
|
||||
"webdriver/tests/element_click/__init__.py": [
|
||||
|
@ -586721,7 +586696,7 @@
|
|||
"support"
|
||||
],
|
||||
"webdriver/tests/support/asserts.py": [
|
||||
"fd28bb9531b1644b726b7baba00a09871bd0dd3f",
|
||||
"4e4f29b9d305383e5bcfa01fa1ba789d0c12ef93",
|
||||
"support"
|
||||
],
|
||||
"webdriver/tests/support/fixtures.py": [
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Test Reference</title>
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
|
||||
PASS
|
|
@ -1,26 +0,0 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Test: Dynamic insertion on empty display: contents element with pseudo-elements</title>
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:ecobos@igalia.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-display-3/#valdef-display-contents">
|
||||
<link rel=match href="display-contents-dynamic-pseudo-insertion-001-ref.html">
|
||||
<style>
|
||||
.contents {
|
||||
display: contents;
|
||||
border: 10px solid red;
|
||||
}
|
||||
.contents::before {
|
||||
content: "A";
|
||||
}
|
||||
.contents::after {
|
||||
content: "SS";
|
||||
}
|
||||
</style>
|
||||
<div class="contents"></div>
|
||||
<script>
|
||||
document.body.offsetTop;
|
||||
let span = document.createElement('span');
|
||||
span.innerHTML = "P";
|
||||
let contents = document.querySelector('.contents');
|
||||
contents.parentNode.insertBefore(span, contents);
|
||||
</script>
|
Загрузка…
Ссылка в новой задаче