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

Side by Side Diff: LayoutTests/editing/style/apply-style-crash3.html

Issue 1124863003: Harden changing font style over unknown elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/editing/style/apply-style-crash3-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <unknown>
8 <script>
9
10 if (window.testRunner) {
11 testRunner.dumpAsText();
12 testRunner.waitUntilDone();
13 }
14
15 window.jsTestIsAsync = true;
16
17 function onDOMNodeRemoved(e) {
18 try {
19 e.srcElement.insertAdjacentHTML('afterbegin', ' ');
20 document.execCommand('FontSizeDelta', false, '1px');
21 } catch(e) {}
leviw_travelin_and_unemployed 2015/05/05 18:21:40 Is this try/catch necessary?
sof 2015/05/05 19:47:32 An alternative is to add an Element type check, wh
22 }
23 document.addEventListener("DOMNodeRemoved", onDOMNodeRemoved, false);
24
25 function runTest() {
26 document.designMode = document.designMode == "on" ? "off" : "on";
27 document.execCommand("SelectAll", false)
28 var unknown = document.getElementsByTagName("unknown")[0];
29 unknown.textContent = "sss";
30 unknown.outerHTML = "";
31 document.execCommand("SelectAll", false);
32 // Put description() here so as to not upset test condition.
33 description("Verify that changing the style over an unknown element does not crash.");
34 finishJSTest();
35 }
36
37 window.onload = runTest;
leviw_travelin_and_unemployed 2015/05/05 18:21:40 If you move this script tag to the end, you probab
sof 2015/05/05 19:47:32 Moved stuff around a bit to avoid having to trigge
38 </script>
39 <textarea>
40 </body>
leviw_travelin_and_unemployed 2015/05/05 18:21:40 Nit: </body> and </html> aren't necessary.
sof 2015/05/05 19:47:32 Just following local convention :)
41 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/style/apply-style-crash3-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698