| OLD | NEW |
| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, frame.selection().getSelectionType()); |
| 64 EXPECT_TRUE(frame.selection().isContentEditable()) | 64 EXPECT_TRUE(frame.selection() |
| 65 .computeVisibleSelectionInDOMTreeDeprecated() |
| 66 .isContentEditable()) |
| 65 << "We should be pasting into something editable."; | 67 << "We should be pasting into something editable."; |
| 66 | 68 |
| 67 Pasteboard* pasteboard = Pasteboard::generalPasteboard(); | 69 Pasteboard* pasteboard = Pasteboard::generalPasteboard(); |
| 68 pasteboard->writeHTML(htmlToPaste, blankURL(), "", false); | 70 pasteboard->writeHTML(htmlToPaste, blankURL(), "", false); |
| 69 EXPECT_TRUE(frame.editor().executeCommand("Paste")); | 71 EXPECT_TRUE(frame.editor().executeCommand("Paste")); |
| 70 | 72 |
| 71 return body->innerHTML(); | 73 return body->innerHTML(); |
| 72 } | 74 } |
| 73 | 75 |
| 74 // Integration tests. | 76 // Integration tests. |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 Attribute fineAttribute(SVGNames::fromAttr, "hello, world!"); | 385 Attribute fineAttribute(SVGNames::fromAttr, "hello, world!"); |
| 384 Document* document = Document::create(); | 386 Document* document = Document::create(); |
| 385 Element* element = SVGSetElement::create(*document); | 387 Element* element = SVGSetElement::create(*document); |
| 386 EXPECT_FALSE( | 388 EXPECT_FALSE( |
| 387 element->isSVGAnimationAttributeSettingJavaScriptURL(fineAttribute)) | 389 element->isSVGAnimationAttributeSettingJavaScriptURL(fineAttribute)) |
| 388 << "The animate element should not identify a 'from' attribute with an " | 390 << "The animate element should not identify a 'from' attribute with an " |
| 389 "innocuous value as setting a JavaScript URL."; | 391 "innocuous value as setting a JavaScript URL."; |
| 390 } | 392 } |
| 391 | 393 |
| 392 } // namespace blink | 394 } // namespace blink |
| OLD | NEW |