| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 String contentAfterPastingHTML( | 52 String contentAfterPastingHTML( |
| 53 DummyPageHolder* pageHolder, | 53 DummyPageHolder* pageHolder, |
| 54 const char* htmlToPaste) | 54 const char* htmlToPaste) |
| 55 { | 55 { |
| 56 LocalFrame& frame = pageHolder->frame(); | 56 LocalFrame& frame = pageHolder->frame(); |
| 57 HTMLElement* body = pageHolder->document().body(); | 57 HTMLElement* body = pageHolder->document().body(); |
| 58 | 58 |
| 59 // Make the body editable, and put the caret in it. | 59 // Make the body editable, and put the caret in it. |
| 60 body->setAttribute(HTMLNames::contenteditableAttr, "true"); | 60 body->setAttribute(HTMLNames::contenteditableAttr, "true"); |
| 61 frame.selection().setSelection(VisibleSelection::selectionFromContentsOfNode
(body)); | 61 frame.selection().setSelection(VisibleSelection::selectionFromContentsOfNode
(body)); |
| 62 EXPECT_EQ(CaretSelection, frame.selection().selectionType()); | 62 EXPECT_EQ(CaretSelection, frame.selection().getSelectionType()); |
| 63 EXPECT_TRUE(frame.selection().isContentEditable()) << | 63 EXPECT_TRUE(frame.selection().isContentEditable()) << |
| 64 "We should be pasting into something editable."; | 64 "We should be pasting into something editable."; |
| 65 | 65 |
| 66 Pasteboard* pasteboard = Pasteboard::generalPasteboard(); | 66 Pasteboard* pasteboard = Pasteboard::generalPasteboard(); |
| 67 pasteboard->writeHTML(htmlToPaste, blankURL(), "", false); | 67 pasteboard->writeHTML(htmlToPaste, blankURL(), "", false); |
| 68 EXPECT_TRUE(frame.editor().executeCommand("Paste")); | 68 EXPECT_TRUE(frame.editor().executeCommand("Paste")); |
| 69 | 69 |
| 70 return body->innerHTML(); | 70 return body->innerHTML(); |
| 71 } | 71 } |
| 72 | 72 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 Attribute fineAttribute(SVGNames::fromAttr, "hello, world!"); | 405 Attribute fineAttribute(SVGNames::fromAttr, "hello, world!"); |
| 406 RefPtrWillBeRawPtr<Document> document = Document::create(); | 406 RefPtrWillBeRawPtr<Document> document = Document::create(); |
| 407 RefPtrWillBeRawPtr<Element> element = SVGSetElement::create(*document); | 407 RefPtrWillBeRawPtr<Element> element = SVGSetElement::create(*document); |
| 408 EXPECT_FALSE( | 408 EXPECT_FALSE( |
| 409 element->isSVGAnimationAttributeSettingJavaScriptURL(fineAttribute)) << | 409 element->isSVGAnimationAttributeSettingJavaScriptURL(fineAttribute)) << |
| 410 "The animate element should not identify a 'from' attribute with an " | 410 "The animate element should not identify a 'from' attribute with an " |
| 411 "innocuous value as setting a JavaScript URL."; | 411 "innocuous value as setting a JavaScript URL."; |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace blink | 414 } // namespace blink |
| OLD | NEW |