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

Unified Diff: third_party/WebKit/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js

Issue 2800723002: Ensure we never remove the style attribute when syncing it from CSSOM. (Closed)
Patch Set: Nits Created 3 years, 8 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
Index: third_party/WebKit/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js b/third_party/WebKit/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js
index da45460b47be73b6d231b9ab41a60c94c2be794e..5d72409af40dea2be727634fee9d3614009492ba 100644
--- a/third_party/WebKit/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js
@@ -9,8 +9,9 @@ function testSingleToggle(toggleCommand, initialContents, expectedContents)
testContainer.innerHTML = initialContents;
window.getSelection().selectAllChildren(testContainer);
document.execCommand(toggleCommand, false, null);
- var action = 'one ' + toggleCommand + ' command converted "' + initialContents + '" to "' + expectedContents;
- if (testContainer.innerHTML === expectedContents)
+ var actualContents = testContainer.innerHTML;
+ var action = 'one ' + toggleCommand + ' command converted "' + initialContents + '" to "' + actualContents;
+ if (actualContents === expectedContents)
testPassed(action);
else
testFailed(action + '", expected "' + expectedContents + '"');
@@ -35,10 +36,10 @@ for (var i = 0; i < platforms.length; i++) {
// Following tests are cross-platform
testSingleToggle("bold", "<u><span id='test'><b>hello</b></span><b>world</b></u>", '<u><span id="test">hello</span>world</u>');
- testSingleToggle("bold", "<span id='test' style='font-weight:normal;'><b>hello</b></span>", '<span id="test">hello</span>');
+ testSingleToggle("bold", "<span id='test' style='font-weight:normal;'><b>hello</b></span>", '<span id="test" style="">hello</span>');
testSingleToggle("bold", "<div><b>hello</b><br><br><b>world</b></div>", "<div>hello<br><br>world</div>");
testSingleToggle("italic", "<i>hello </i><img>", "hello <img>");
- testSingleToggle("italic", "<i><b>hello</b>world</i>", "<b>hello</b>world");
+ testSingleToggle("italic", "<i><b>hello</b>world</i>", "<b style=\"\">hello</b>world");
testSingleToggle("italic", "<span style='font-style: normal;'> <i> hello </i> </span>", " hello ");
testSingleToggle("italic", "<p><i>hello</i><span style='font-style:italic;'>world</span></p>", "<p>helloworld</p>");
testSingleToggle("italic", "<s><b>hello<i> world</i></b></s>", "<s><b><i>hello world</i></b></s>");

Powered by Google App Engine
This is Rietveld 408576698