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

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

Issue 2700123003: DO NOT COMMIT: Results of running old (current) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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
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 <memory>
8 #include "core/HTMLNames.h" 9 #include "core/HTMLNames.h"
9 #include "core/SVGNames.h" 10 #include "core/SVGNames.h"
10 #include "core/XLinkNames.h" 11 #include "core/XLinkNames.h"
11 #include "core/clipboard/Pasteboard.h" 12 #include "core/clipboard/Pasteboard.h"
12 #include "core/dom/QualifiedName.h" 13 #include "core/dom/QualifiedName.h"
13 #include "core/editing/Editor.h" 14 #include "core/editing/Editor.h"
14 #include "core/editing/SelectionType.h" 15 #include "core/editing/SelectionType.h"
15 #include "core/editing/VisibleSelection.h" 16 #include "core/editing/VisibleSelection.h"
16 #include "core/html/HTMLElement.h" 17 #include "core/html/HTMLElement.h"
17 #include "core/svg/SVGAElement.h" 18 #include "core/svg/SVGAElement.h"
18 #include "core/svg/SVGAnimateElement.h" 19 #include "core/svg/SVGAnimateElement.h"
19 #include "core/svg/SVGDiscardElement.h" 20 #include "core/svg/SVGDiscardElement.h"
20 #include "core/svg/SVGSetElement.h" 21 #include "core/svg/SVGSetElement.h"
21 #include "core/svg/animation/SVGSMILElement.h" 22 #include "core/svg/animation/SVGSMILElement.h"
22 #include "core/svg/properties/SVGPropertyInfo.h" 23 #include "core/svg/properties/SVGPropertyInfo.h"
23 #include "core/testing/DummyPageHolder.h" 24 #include "core/testing/DummyPageHolder.h"
24 #include "platform/geometry/IntSize.h" 25 #include "platform/geometry/IntSize.h"
25 #include "platform/weborigin/KURL.h" 26 #include "platform/weborigin/KURL.h"
26 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
27 #include "wtf/Vector.h" 28 #include "wtf/Vector.h"
28 #include "wtf/text/AtomicString.h" 29 #include "wtf/text/AtomicString.h"
29 #include "wtf/text/WTFString.h" 30 #include "wtf/text/WTFString.h"
30 #include <memory>
31 31
32 // Test that SVG content with JavaScript URLs is sanitized by removing 32 // Test that SVG content with JavaScript URLs is sanitized by removing
33 // the URLs. This sanitization happens when the content is pasted or 33 // the URLs. This sanitization happens when the content is pasted or
34 // drag-dropped into an editable element. 34 // drag-dropped into an editable element.
35 // 35 //
36 // There are two vectors for JavaScript URLs in SVG content: 36 // There are two vectors for JavaScript URLs in SVG content:
37 // 37 //
38 // 1. Attributes, for example xlink:href/href in an <svg:a> element. 38 // 1. Attributes, for example xlink:href/href in an <svg:a> element.
39 // 2. Animations which set those attributes, for example 39 // 2. Animations which set those attributes, for example
40 // <animate attributeName="xlink:href" values="javascript:... 40 // <animate attributeName="xlink:href" values="javascript:...
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 Attribute fineAttribute(SVGNames::fromAttr, "hello, world!"); 383 Attribute fineAttribute(SVGNames::fromAttr, "hello, world!");
384 Document* document = Document::create(); 384 Document* document = Document::create();
385 Element* element = SVGSetElement::create(*document); 385 Element* element = SVGSetElement::create(*document);
386 EXPECT_FALSE( 386 EXPECT_FALSE(
387 element->isSVGAnimationAttributeSettingJavaScriptURL(fineAttribute)) 387 element->isSVGAnimationAttributeSettingJavaScriptURL(fineAttribute))
388 << "The animate element should not identify a 'from' attribute with an " 388 << "The animate element should not identify a 'from' attribute with an "
389 "innocuous value as setting a JavaScript URL."; 389 "innocuous value as setting a JavaScript URL.";
390 } 390 }
391 391
392 } // namespace blink 392 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698