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

Side by Side Diff: third_party/WebKit/Source/core/svg/UnsafeSVGAttributeSanitizationTest.cpp

Issue 2706013005: Expand FrameSeleciton::getSelectionType() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-22T21:26:37 rebase Created 3 years, 9 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 | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // FIXME(dominicc): Poor confused check-webkit-style demands Attribute.h here. 5 // FIXME(dominicc): Poor confused check-webkit-style demands Attribute.h here.
6 #include "core/dom/Attribute.h" 6 #include "core/dom/Attribute.h"
7 7
8 #include "core/HTMLNames.h" 8 #include "core/HTMLNames.h"
9 #include "core/SVGNames.h" 9 #include "core/SVGNames.h"
10 #include "core/XLinkNames.h" 10 #include "core/XLinkNames.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 String contentAfterPastingHTML(DummyPageHolder* pageHolder, 53 String contentAfterPastingHTML(DummyPageHolder* pageHolder,
54 const char* htmlToPaste) { 54 const char* htmlToPaste) {
55 LocalFrame& frame = pageHolder->frame(); 55 LocalFrame& frame = pageHolder->frame();
56 HTMLElement* body = pageHolder->document().body(); 56 HTMLElement* body = pageHolder->document().body();
57 57
58 // Make the body editable, and put the caret in it. 58 // Make the body editable, and put the caret in it.
59 body->setAttribute(HTMLNames::contenteditableAttr, "true"); 59 body->setAttribute(HTMLNames::contenteditableAttr, "true");
60 frame.document()->updateStyleAndLayout(); 60 frame.document()->updateStyleAndLayout();
61 frame.selection().setSelection( 61 frame.selection().setSelection(
62 SelectionInDOMTree::Builder().selectAllChildren(*body).build()); 62 SelectionInDOMTree::Builder().selectAllChildren(*body).build());
63 EXPECT_EQ(CaretSelection, frame.selection().getSelectionType()); 63 EXPECT_EQ(CaretSelection,
64 frame.selection()
65 .computeVisibleSelectionInDOMTreeDeprecated()
66 .getSelectionType());
64 EXPECT_TRUE(frame.selection() 67 EXPECT_TRUE(frame.selection()
65 .computeVisibleSelectionInDOMTreeDeprecated() 68 .computeVisibleSelectionInDOMTreeDeprecated()
66 .isContentEditable()) 69 .isContentEditable())
67 << "We should be pasting into something editable."; 70 << "We should be pasting into something editable.";
68 71
69 Pasteboard* pasteboard = Pasteboard::generalPasteboard(); 72 Pasteboard* pasteboard = Pasteboard::generalPasteboard();
70 pasteboard->writeHTML(htmlToPaste, blankURL(), "", false); 73 pasteboard->writeHTML(htmlToPaste, blankURL(), "", false);
71 EXPECT_TRUE(frame.editor().executeCommand("Paste")); 74 EXPECT_TRUE(frame.editor().executeCommand("Paste"));
72 75
73 return body->innerHTML(); 76 return body->innerHTML();
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 Attribute fineAttribute(SVGNames::fromAttr, "hello, world!"); 388 Attribute fineAttribute(SVGNames::fromAttr, "hello, world!");
386 Document* document = Document::create(); 389 Document* document = Document::create();
387 Element* element = SVGSetElement::create(*document); 390 Element* element = SVGSetElement::create(*document);
388 EXPECT_FALSE( 391 EXPECT_FALSE(
389 element->isSVGAnimationAttributeSettingJavaScriptURL(fineAttribute)) 392 element->isSVGAnimationAttributeSettingJavaScriptURL(fineAttribute))
390 << "The animate element should not identify a 'from' attribute with an " 393 << "The animate element should not identify a 'from' attribute with an "
391 "innocuous value as setting a JavaScript URL."; 394 "innocuous value as setting a JavaScript URL.";
392 } 395 }
393 396
394 } // namespace blink 397 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698