From cf3b3f1eb5cbbceb328a747b9d4c768850f15afb Mon Sep 17 00:00:00 2001 From: "arthur.iakab" Date: Tue, 2 Apr 2019 02:44:43 +0300 Subject: [PATCH] Backed out 11 changesets (bug 1539265) for causing debugger failures CLOSED TREE Backed out changeset 8206b880f9ec (bug 1539265) Backed out changeset be9f5f73bdfe (bug 1539265) Backed out changeset f78146b8aa17 (bug 1539265) Backed out changeset 18fa7e971a0d (bug 1539265) Backed out changeset 6eaf5bdd945c (bug 1539265) Backed out changeset 3add7d4d4853 (bug 1539265) Backed out changeset 8015aeb5279d (bug 1539265) Backed out changeset 19c8e404ac5f (bug 1539265) Backed out changeset 637a9d6af0f3 (bug 1539265) Backed out changeset 72bbb4b28932 (bug 1539265) Backed out changeset 931e98129878 (bug 1539265) --- .../devtools-reps/src/reps/element-node.js | 15 +-- .../src/reps/stubs/element-node.js | 13 -- .../src/reps/tests/element-node.js | 29 ----- devtools/client/inspector/breadcrumbs.js | 16 +-- devtools/client/inspector/markup/markup.js | 16 +-- .../client/inspector/markup/test/browser.ini | 2 - .../browser_markup_accessibility_semantics.js | 12 +- ...er_markup_dragdrop_before_marker_pseudo.js | 62 --------- ...kup_shadowdom_marker_and_before_pseudos.js | 112 ----------------- .../markup/test/doc_markup_dragdrop.html | 6 - .../markup/views/read-only-editor.js | 8 +- .../test/browser_rules_pseudo-element_01.js | 24 ---- .../test/browser_rules_pseudo-element_02.js | 14 --- .../rules/test/doc_pseudoelement.html | 8 -- devtools/client/inspector/shared/utils.js | 10 +- .../client/shared/components/reps/reps.js | 119 ++++++++---------- devtools/server/actors/inspector/css-logic.js | 2 +- .../actors/inspector/event-collector.js | 3 +- devtools/server/actors/inspector/node.js | 6 +- devtools/server/actors/inspector/utils.js | 9 +- devtools/server/actors/inspector/walker.js | 17 +-- devtools/server/actors/utils/walker-search.js | 5 +- devtools/shared/fronts/node.js | 6 +- devtools/shared/inspector/css-logic.js | 9 +- devtools/shared/layout/utils.js | 12 -- 25 files changed, 93 insertions(+), 442 deletions(-) delete mode 100644 devtools/client/inspector/markup/test/browser_markup_dragdrop_before_marker_pseudo.js delete mode 100644 devtools/client/inspector/markup/test/browser_markup_shadowdom_marker_and_before_pseudos.js diff --git a/devtools/client/debugger/new/packages/devtools-reps/src/reps/element-node.js b/devtools/client/debugger/new/packages/devtools-reps/src/reps/element-node.js index 3152c40b4a88..763daeac3bbd 100644 --- a/devtools/client/debugger/new/packages/devtools-reps/src/reps/element-node.js +++ b/devtools/client/debugger/new/packages/devtools-reps/src/reps/element-node.js @@ -93,8 +93,7 @@ function getElements(grip, mode) { attributes, nodeName, isAfterPseudoElement, - isBeforePseudoElement, - isMarkerPseudoElement, + isBeforePseudoElement } = grip.preview; const nodeNameElement = span( { @@ -103,19 +102,11 @@ function getElements(grip, mode) { nodeName ); - let pseudoNodeName; - if (isAfterPseudoElement) { - pseudoNodeName = "after"; - } else if (isBeforePseudoElement) { - pseudoNodeName = "before"; - } else if (isMarkerPseudoElement) { - pseudoNodeName = "marker"; - } - if (pseudoNodeName) { + if (isAfterPseudoElement || isBeforePseudoElement) { return [ span( { className: "attrName" }, - `::${pseudoNodeName}` + `::${isAfterPseudoElement ? "after" : "before"}` ) ]; } diff --git a/devtools/client/debugger/new/packages/devtools-reps/src/reps/stubs/element-node.js b/devtools/client/debugger/new/packages/devtools-reps/src/reps/stubs/element-node.js index cd8e7718f9be..7fa5413be9bf 100644 --- a/devtools/client/debugger/new/packages/devtools-reps/src/reps/stubs/element-node.js +++ b/devtools/client/debugger/new/packages/devtools-reps/src/reps/stubs/element-node.js @@ -248,19 +248,6 @@ stubs.set("NodeWithLongStringAttribute", { } }); -stubs.set("MarkerPseudoElement", { - type: "object", - actor: "server1.conn1.child1/obj26", - preview: { - kind: "DOMNode", - nodeType: 1, - nodeName: "_moz_generated_content_marker", - attributes: {}, - attributesLength: 0, - isMarkerPseudoElement: true - } -}); - stubs.set("BeforePseudoElement", { type: "object", actor: "server1.conn1.child1/obj27", diff --git a/devtools/client/debugger/new/packages/devtools-reps/src/reps/tests/element-node.js b/devtools/client/debugger/new/packages/devtools-reps/src/reps/tests/element-node.js index 59099b1cea72..76a1c4d21e5f 100644 --- a/devtools/client/debugger/new/packages/devtools-reps/src/reps/tests/element-node.js +++ b/devtools/client/debugger/new/packages/devtools-reps/src/reps/tests/element-node.js @@ -465,35 +465,6 @@ describe("ElementNode - Element attribute cropping", () => { }); }); -describe("ElementNode - : Marker pseudo element", () => { - const stub = stubs.get("MarkerPseudoElement"); - - it("selects ElementNode Rep", () => { - expect(getRep(stub)).toBe(ElementNode.rep); - }); - - it("renders with expected text content", () => { - const renderedComponent = shallow( - ElementNode.rep({ - object: stub - }) - ); - - expect(renderedComponent.text()).toEqual("::marker"); - }); - - it("renders with expected text content in tiny mode", () => { - const renderedComponent = shallow( - ElementNode.rep({ - object: stub, - mode: MODE.TINY - }) - ); - - expect(renderedComponent.text()).toEqual("::marker"); - }); -}); - describe("ElementNode - : Before pseudo element", () => { const stub = stubs.get("BeforePseudoElement"); diff --git a/devtools/client/inspector/breadcrumbs.js b/devtools/client/inspector/breadcrumbs.js index 89abbf58514d..cb5c09a01bcd 100644 --- a/devtools/client/inspector/breadcrumbs.js +++ b/devtools/client/inspector/breadcrumbs.js @@ -428,12 +428,8 @@ HTMLBreadcrumbs.prototype = { */ prettyPrintNodeAsText: function(node) { let text = node.isShadowRoot ? SHADOW_ROOT_TAGNAME : node.displayName; - if (node.isMarkerPseudoElement) { - text = "::marker"; - } else if (node.isBeforePseudoElement) { - text = "::before"; - } else if (node.isAfterPseudoElement) { - text = "::after"; + if (node.isPseudoElement) { + text = node.isBeforePseudoElement ? "::before" : "::after"; } if (node.id) { @@ -476,12 +472,8 @@ HTMLBreadcrumbs.prototype = { pseudosLabel.className = "breadcrumbs-widget-item-pseudo-classes plain"; let tagText = node.isShadowRoot ? SHADOW_ROOT_TAGNAME : node.displayName; - if (node.isMarkerPseudoElement) { - tagText = "::marker"; - } else if (node.isBeforePseudoElement) { - tagText = "::before"; - } else if (node.isAfterPseudoElement) { - tagText = "::after"; + if (node.isPseudoElement) { + tagText = node.isBeforePseudoElement ? "::before" : "::after"; } let idText = node.id ? ("#" + node.id) : ""; let classesText = ""; diff --git a/devtools/client/inspector/markup/markup.js b/devtools/client/inspector/markup/markup.js index 6126ddb0b360..0c081aada250 100644 --- a/devtools/client/inspector/markup/markup.js +++ b/devtools/client/inspector/markup/markup.js @@ -2180,16 +2180,12 @@ MarkupView.prototype = { nextSibling = target.parentNode.container.node; } - if (nextSibling) { - while ( - nextSibling.isMarkerPseudoElement || nextSibling.isBeforePseudoElement - ) { - nextSibling = this.getContainer(nextSibling).elt.nextSibling.container.node; - } - if (nextSibling.isAfterPseudoElement) { - parent = target.parentNode.container.node.parentNode(); - nextSibling = null; - } + if (nextSibling && nextSibling.isBeforePseudoElement) { + nextSibling = target.parentNode.parentNode.children[1].container.node; + } + if (nextSibling && nextSibling.isAfterPseudoElement) { + parent = target.parentNode.container.node.parentNode(); + nextSibling = null; } if (parent.nodeType !== nodeConstants.ELEMENT_NODE) { diff --git a/devtools/client/inspector/markup/test/browser.ini b/devtools/client/inspector/markup/test/browser.ini index 0173258f7d38..681233776557 100644 --- a/devtools/client/inspector/markup/test/browser.ini +++ b/devtools/client/inspector/markup/test/browser.ini @@ -115,7 +115,6 @@ skip-if = (os == 'linux' && bits == 32 && debug) || (os == "win" && processor == [browser_markup_display_node_02.js] [browser_markup_dragdrop_autoscroll_01.js] [browser_markup_dragdrop_autoscroll_02.js] -[browser_markup_dragdrop_before_marker_pseudo.js] [browser_markup_dragdrop_distance.js] [browser_markup_dragdrop_draggable.js] [browser_markup_dragdrop_dragRootNode.js] @@ -202,7 +201,6 @@ subsuite = clipboard [browser_markup_shadowdom_delete.js] [browser_markup_shadowdom_dynamic.js] [browser_markup_shadowdom_hover.js] -[browser_markup_shadowdom_marker_and_before_pseudos.js] [browser_markup_shadowdom_maxchildren.js] [browser_markup_shadowdom_mutations_shadow.js] [browser_markup_shadowdom_navigation.js] diff --git a/devtools/client/inspector/markup/test/browser_markup_accessibility_semantics.js b/devtools/client/inspector/markup/test/browser_markup_accessibility_semantics.js index 708c0e14611b..b7d4269e4db1 100644 --- a/devtools/client/inspector/markup/test/browser_markup_accessibility_semantics.js +++ b/devtools/client/inspector/markup/test/browser_markup_accessibility_semantics.js @@ -14,9 +14,9 @@ add_task(async function() { data:text/html;charset=utf-8,

foo

bar -
-
-
`); + `); const markup = inspector.markup; const doc = markup.doc; const win = doc.defaultView; @@ -25,7 +25,7 @@ add_task(async function() { const bodyContainer = await getContainerForSelector("body", inspector); const spanContainer = await getContainerForSelector("span", inspector); const headerContainer = await getContainerForSelector("h1", inspector); - const listContainer = await getContainerForSelector("dl", inspector); + const listContainer = await getContainerForSelector("ul", inspector); // Focus on the tree element. rootElt.focus(); @@ -71,7 +71,7 @@ add_task(async function() { "Closed tree item should have aria-expanded unset"); info("Selecting and expanding list container"); - await selectNode("dl", inspector); + await selectNode("ul", inspector); EventUtils.synthesizeKey("VK_RIGHT", {}, win); await waitForMultipleChildrenUpdates(inspector); @@ -80,7 +80,7 @@ add_task(async function() { "Active descendant should not be set to list container tagLine"); is(listContainer.tagLine.getAttribute("aria-expanded"), "true", "Open tree item should have aria-expanded set"); - const listItemContainer = await getContainerForSelector("dt", inspector); + const listItemContainer = await getContainerForSelector("li", inspector); is(listItemContainer.tagLine.getAttribute("aria-level"), TOP_CONTAINER_LEVEL + 1, "Grand child container tagLine should have nested level up to date"); diff --git a/devtools/client/inspector/markup/test/browser_markup_dragdrop_before_marker_pseudo.js b/devtools/client/inspector/markup/test/browser_markup_dragdrop_before_marker_pseudo.js deleted file mode 100644 index 464bd9ad9833..000000000000 --- a/devtools/client/inspector/markup/test/browser_markup_dragdrop_before_marker_pseudo.js +++ /dev/null @@ -1,62 +0,0 @@ -/* vim: set ts=2 et sw=2 tw=80: */ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -// Test drag and dropping a node before a ::marker pseudo. - -const TEST_URL = URL_ROOT + "doc_markup_dragdrop.html"; - -add_task(async function() { - const {inspector} = await openInspectorForURL(TEST_URL); - - info("Expand #list node"); - const parentFront = await getNodeFront("#list", inspector); - await inspector.markup.expandNode(parentFront.parentNode()); - await inspector.markup.expandNode(parentFront); - await waitForMultipleChildrenUpdates(inspector); - - info("Scroll #list into view"); - const parentContainer = await getContainerForNodeFront(parentFront, inspector); - parentContainer.elt.scrollIntoView(true); - - info("Test placing an element before a ::marker psuedo"); - await moveElementBeforeMarker("#last-list-child", parentFront, inspector); - const childNodes = await getChildrenOf(parentFront, inspector); - is(childNodes[0], "_moz_generated_content_marker", - "::marker is still the first child of #list"); - is(childNodes[1], "last-list-child", - "#last-list-child is now the second child of #list"); - is(childNodes[2], "first-list-child", - "#first-list-child is now the last child of #list"); -}); - -async function moveElementBeforeMarker(selector, parentFront, inspector) { - info(`Placing ${selector} before its parent's ::marker`); - - const container = await getContainerForSelector(selector, inspector); - const parentContainer = await getContainerForNodeFront(parentFront, inspector); - const offsetY = (parentContainer.tagLine.offsetTop + - parentContainer.tagLine.offsetHeight) - container.tagLine.offsetTop; - - const onMutated = inspector.once("markupmutation"); - const uiUpdate = inspector.once("inspector-updated"); - - await simulateNodeDragAndDrop(inspector, selector, 0, offsetY); - - const mutations = await onMutated; - await uiUpdate; - - is(mutations.length, 2, "2 mutations were received"); -} - -async function getChildrenOf(parentFront, {walker}) { - const {nodes} = await walker.children(parentFront); - return nodes.map(node => { - if (node.isMarkerPseudoElement) { - return node.displayName; - } - return node.id; - }); -} diff --git a/devtools/client/inspector/markup/test/browser_markup_shadowdom_marker_and_before_pseudos.js b/devtools/client/inspector/markup/test/browser_markup_shadowdom_marker_and_before_pseudos.js deleted file mode 100644 index 9df1a0af4c79..000000000000 --- a/devtools/client/inspector/markup/test/browser_markup_shadowdom_marker_and_before_pseudos.js +++ /dev/null @@ -1,112 +0,0 @@ -/* vim: set ts=2 et sw=2 tw=80: */ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -requestLongerTimeout(1); - -// Test a few static pages using webcomponents with ::marker and ::before -// pseudos and check that they are displayed as expected in the markup view. - -const TEST_DATA = [ - { - // Test that ::before on an empty shadow host is displayed when the host - // has a ::marker. - title: "::before after ::marker, empty node", - url: `data:text/html;charset=utf-8, - - - - - `, - tree: ` - test-component - #shadow-root - ::marker - ::before`, - - }, { - // Test ::before on a shadow host with content is displayed when the host - // has a ::marker. - title: "::before after ::marker, non-empty node", - url: `data:text/html;charset=utf-8, - - - -
-
- - `, - tree: ` - test-component - #shadow-root - slot - div!slotted - ::marker - ::before - class="light-dom"`, - }, { - // Test just ::marker on a shadow host - title: "just ::marker, no ::before", - url: `data:text/html;charset=utf-8, - - - - - `, - tree: ` - test-component - #shadow-root - ::marker`, - }, -]; - -for (const {url, tree, title} of TEST_DATA) { - // Test each configuration in both open and closed modes - add_task(async function() { - info(`Testing: [${title}] in OPEN mode`); - const {inspector, tab} = await openInspectorForURL(url.replace(/#MODE#/g, "open")); - await assertMarkupViewAsTree(tree, "test-component", inspector); - await removeTab(tab); - }); - add_task(async function() { - info(`Testing: [${title}] in CLOSED mode`); - const {inspector, tab} = await openInspectorForURL(url.replace(/#MODE#/g, "closed")); - await assertMarkupViewAsTree(tree, "test-component", inspector); - await removeTab(tab); - }); -} diff --git a/devtools/client/inspector/markup/test/doc_markup_dragdrop.html b/devtools/client/inspector/markup/test/doc_markup_dragdrop.html index a13d42cbceb0..25b9707e2007 100644 --- a/devtools/client/inspector/markup/test/doc_markup_dragdrop.html +++ b/devtools/client/inspector/markup/test/doc_markup_dragdrop.html @@ -25,12 +25,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=858038
slot1-2
-
    -
  1. List item startList item end
  2. -
-