Index: LayoutTests/inspector/elements/styles/pseudo-elements.html |
diff --git a/LayoutTests/inspector/elements/styles/pseudo-elements.html b/LayoutTests/inspector/elements/styles/pseudo-elements.html |
deleted file mode 100644 |
index 3d0e3da34b4d1d4aded2394fb3b5c9b5c9391fc7..0000000000000000000000000000000000000000 |
--- a/LayoutTests/inspector/elements/styles/pseudo-elements.html |
+++ /dev/null |
@@ -1,193 +0,0 @@ |
-<html> |
-<head> |
-<style> |
-#inspected:before, .some-other-selector { |
- content: "BEFORE"; |
-} |
- |
-#inspected:after { |
- content: "AFTER"; |
-} |
-</style> |
-<style> |
-#empty::before { |
- content: "EmptyBefore"; |
-} |
- |
-#empty::after { |
- content: "EmptyAfter"; |
-} |
-</style> |
-<script src="../../../http/tests/inspector/inspector-test.js"></script> |
-<script src="../../../http/tests/inspector/elements-test.js"></script> |
-<script> |
- |
-function removeLastRule() |
-{ |
- document.styleSheets[0].deleteRule(document.styleSheets[0].cssRules.length - 1); |
-} |
- |
-function addAfterRule() |
-{ |
- document.styleSheets[0].addRule("#inspected:after", "content: \"AFTER\""); |
-} |
- |
-function addBeforeRule() |
-{ |
- document.styleSheets[0].addRule("#inspected:before", "content: \"BEFORE\""); |
-} |
- |
-function modifyTextContent() |
-{ |
- document.getElementById("inspected").textContent = "bar"; |
-} |
- |
-function clearTextContent() |
-{ |
- document.getElementById("inspected").textContent = ""; |
-} |
- |
-function removeNode() |
-{ |
- document.getElementById("inspected").remove(); |
-} |
- |
-function test() |
-{ |
- var containerNode; |
- var inspectedNode; |
- |
- InspectorTest.runTestSuite([ |
- function dumpOriginalTree(next) |
- { |
- InspectorTest.expandElementsTree(callback); |
- function callback() |
- { |
- containerNode = InspectorTest.expandedNodeWithId("container"); |
- inspectedNode = InspectorTest.expandedNodeWithId("inspected"); |
- InspectorTest.addResult("Original elements tree:"); |
- InspectorTest.dumpElementsTree(containerNode); |
- next(); |
- } |
- }, |
- |
- function dumpNormalNodeStyles(next) |
- { |
- selectNodeAndDumpStyles("inspected", "", next); |
- }, |
- |
- function dumpBeforeStyles(next) |
- { |
- selectNodeAndDumpStyles("inspected", "before", next); |
- }, |
- |
- function dumpAfterStyles(next) |
- { |
- selectNodeAndDumpStyles("inspected", "after", next); |
- }, |
- |
- function removeAfter(next) |
- { |
- executeAndDumpTree("removeLastRule()", WebInspector.DOMModel.Events.NodeRemoved, next); |
- }, |
- |
- function removeBefore(next) |
- { |
- executeAndDumpTree("removeLastRule()", WebInspector.DOMModel.Events.NodeRemoved, next); |
- }, |
- |
- function addAfter(next) |
- { |
- executeAndDumpTree("addAfterRule()", WebInspector.DOMModel.Events.NodeInserted, expandAndDumpTree.bind(this, next)); |
- }, |
- |
- function addBefore(next) |
- { |
- executeAndDumpTree("addBeforeRule()", WebInspector.DOMModel.Events.NodeInserted, next); |
- }, |
- |
- function modifyTextContent(next) |
- { |
- executeAndDumpTree("modifyTextContent()", WebInspector.DOMModel.Events.NodeInserted, next); |
- }, |
- |
- function clearTextContent(next) |
- { |
- executeAndDumpTree("clearTextContent()", WebInspector.DOMModel.Events.NodeRemoved, next); |
- }, |
- |
- function removeNodeAndCheckPseudoElementsUnbound(next) |
- { |
- var inspectedBefore = inspectedNode.beforePseudoElement(); |
- var inspectedAfter = inspectedNode.afterPseudoElement(); |
- |
- executeAndDumpTree("removeNode()", WebInspector.DOMModel.Events.NodeRemoved, callback); |
- function callback() |
- { |
- InspectorTest.addResult("inspected:before DOMNode in DOMAgent: " + !!(InspectorTest.domModel.nodeForId(inspectedBefore.id))); |
- InspectorTest.addResult("inspected:after DOMNode in DOMAgent: " + !!(InspectorTest.domModel.nodeForId(inspectedAfter.id))); |
- next(); |
- } |
- } |
- ]); |
- |
- function executeAndDumpTree(pageFunction, eventName, next) |
- { |
- InspectorTest.domModel.addEventListener(eventName, domCallback, this); |
- InspectorTest.evaluateInPage(pageFunction); |
- |
- function domCallback() |
- { |
- InspectorTest.domModel.removeEventListener(eventName, domCallback, this); |
- InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.ElementsTreeUpdated, treeCallback, this); |
- } |
- |
- function treeCallback() |
- { |
- InspectorTest.firstElementsTreeOutline().removeEventListener(WebInspector.ElementsTreeOutline.Events.ElementsTreeUpdated, treeCallback, this); |
- InspectorTest.dumpElementsTree(containerNode); |
- next(); |
- } |
- } |
- |
- function expandAndDumpTree(next) |
- { |
- InspectorTest.addResult("== Expanding: =="); |
- InspectorTest.expandElementsTree(callback); |
- function callback() |
- { |
- InspectorTest.dumpElementsTree(containerNode); |
- next(); |
- } |
- } |
- |
- function selectNodeAndDumpStyles(id, pseudoTypeName, callback) |
- { |
- if (pseudoTypeName) |
- InspectorTest.selectPseudoElementAndWaitForStyles("inspected", pseudoTypeName, stylesCallback); |
- else |
- InspectorTest.selectNodeAndWaitForStyles("inspected", stylesCallback); |
- |
- function stylesCallback() |
- { |
- InspectorTest.dumpSelectedElementStyles(true, false, false, true); |
- callback(); |
- } |
- } |
-} |
- |
-</script> |
-</head> |
- |
-<body onload="runTest()"> |
-<p> |
-Tests that pseudo elements and their styles are handled properly. |
-</p> |
- |
-<div id="container"> |
- <div id="inspected">Text</div> |
- <div id="empty"></div> |
-</div> |
- |
-</body> |
-</html> |