Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: LayoutTests/editing/editing.js

Issue 19888007: Bold and Italic style get stuck when applied on a selection having content with mixed editability (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Bold and Italic style get stuck when applied on a selection having content with mixed editability Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/editing/style/toggle-style-bold-italic.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/editing.js
diff --git a/LayoutTests/editing/editing.js b/LayoutTests/editing/editing.js
index 14af90572c54f5167d3dd93551b4ba1a8781ffd7..8f4e3d22b0709ed720a2c2a5c93af1690a25b439 100644
--- a/LayoutTests/editing/editing.js
+++ b/LayoutTests/editing/editing.js
@@ -904,7 +904,7 @@ function runEditingTest() {
}
var dumpAsText = false;
-var markupResultList = document.createElement('ol');
+var elementsForDumpingMarkupList = [document.createElement('ol')];
function runDumpAsTextEditingTest(enableCallbacks) {
if (window.testRunner) {
@@ -920,17 +920,26 @@ function runDumpAsTextEditingTest(enableCallbacks) {
selection.setPosition(elem, 0);
editingTest();
- document.body.appendChild(markupResultList);
+ for (var i = 0; i < elementsForDumpingMarkupList.length; i++)
+ document.body.appendChild(elementsForDumpingMarkupList[i]);
}
function debugForDumpAsText(name) {
if (dumpAsText && document.getElementById("root")) {
var newItem = document.createElement('li');
newItem.appendChild(document.createTextNode(name+": "+document.getElementById("root").innerHTML));
- markupResultList.appendChild(newItem);
+ elementsForDumpingMarkupList[elementsForDumpingMarkupList.length - 1].appendChild(newItem);
}
}
+function startNewMarkupGroup(label) {
+ if (!elementsForDumpingMarkupList[elementsForDumpingMarkupList.length - 1].hasChildNodes())
+ elementsForDumpingMarkupList.pop();
+ elementsForDumpingMarkupList.push(document.createElement('br'));
+ elementsForDumpingMarkupList.push(document.createTextNode(label));
+ elementsForDumpingMarkupList.push(document.createElement('ol'));
+}
+
//-------------------------------------------------------------------------------------------------------
« no previous file with comments | « no previous file | LayoutTests/editing/style/toggle-style-bold-italic.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698