| 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 16 matching lines...) Expand all Loading... |
| 27 #include "wtf/Vector.h" | 27 #include "wtf/Vector.h" |
| 28 #include "wtf/text/AtomicString.h" | 28 #include "wtf/text/AtomicString.h" |
| 29 #include "wtf/text/WTFString.h" | 29 #include "wtf/text/WTFString.h" |
| 30 | 30 |
| 31 // Test that SVG content with JavaScript URLs is sanitized by removing | 31 // Test that SVG content with JavaScript URLs is sanitized by removing |
| 32 // the URLs. This sanitization happens when the content is pasted or | 32 // the URLs. This sanitization happens when the content is pasted or |
| 33 // drag-dropped into an editable element. | 33 // drag-dropped into an editable element. |
| 34 // | 34 // |
| 35 // There are two vectors for JavaScript URLs in SVG content: | 35 // There are two vectors for JavaScript URLs in SVG content: |
| 36 // | 36 // |
| 37 // 1. Attributes, for example xlink:href/href in an <svg:a> element. | 37 // 1. Attributes, for example xlink:href in an <svg:a> element. |
| 38 // 2. Animations which set those attributes, for example | 38 // 2. Animations which set those attributes, for example |
| 39 // <animate attributeName="xlink:href" values="javascript:... | 39 // <animate attributeName="xlink:href" values="javascript:... |
| 40 // | 40 // |
| 41 // The following SVG elements, although related to animation, cannot | 41 // The following SVG elements, although related to animation, cannot |
| 42 // set JavaScript URLs: | 42 // set JavaScript URLs: |
| 43 // | 43 // |
| 44 // - 'discard' can only remove elements, not set their attributes | 44 // - 'discard' can only remove elements, not set their attributes |
| 45 // - 'animateMotion' does not use attribute name and produces floats | 45 // - 'animateMotion' does not use attribute name and produces floats |
| 46 // - 'animateTransform' can only animate transform lists | 46 // - 'animateTransform' can only animate transform lists |
| 47 | 47 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 72 | 72 |
| 73 // Integration tests. | 73 // Integration tests. |
| 74 | 74 |
| 75 TEST( | 75 TEST( |
| 76 UnsafeSVGAttributeSanitizationTest, | 76 UnsafeSVGAttributeSanitizationTest, |
| 77 pasteAnchor_javaScriptHrefIsStripped) | 77 pasteAnchor_javaScriptHrefIsStripped) |
| 78 { | 78 { |
| 79 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); | 79 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); |
| 80 static const char unsafeContent[] = | 80 static const char unsafeContent[] = |
| 81 "<svg xmlns='http://www.w3.org/2000/svg' " | 81 "<svg xmlns='http://www.w3.org/2000/svg' " |
| 82 " width='1cm' height='1cm'>" | |
| 83 " <a href='javascript:alert()'></a>" | |
| 84 "</svg>"; | |
| 85 String sanitizedContent = | |
| 86 contentAfterPastingHTML(pageHolder.get(), unsafeContent); | |
| 87 | |
| 88 EXPECT_TRUE(sanitizedContent.contains("</a>")) << | |
| 89 "We should have pasted *something*; the document is: " << | |
| 90 sanitizedContent.utf8().data(); | |
| 91 EXPECT_FALSE(sanitizedContent.contains(":alert()")) << | |
| 92 "The JavaScript URL is unsafe and should have been stripped; " | |
| 93 "instead: " << | |
| 94 sanitizedContent.utf8().data(); | |
| 95 } | |
| 96 | |
| 97 TEST( | |
| 98 UnsafeSVGAttributeSanitizationTest, | |
| 99 pasteAnchor_javaScriptXlinkHrefIsStripped) | |
| 100 { | |
| 101 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); | |
| 102 static const char unsafeContent[] = | |
| 103 "<svg xmlns='http://www.w3.org/2000/svg' " | |
| 104 " xmlns:xlink='http://www.w3.org/1999/xlink'" | 82 " xmlns:xlink='http://www.w3.org/1999/xlink'" |
| 105 " width='1cm' height='1cm'>" | 83 " width='1cm' height='1cm'>" |
| 106 " <a xlink:href='javascript:alert()'></a>" | 84 " <a xlink:href='javascript:alert()'></a>" |
| 107 "</svg>"; | 85 "</svg>"; |
| 108 String sanitizedContent = | 86 String sanitizedContent = |
| 109 contentAfterPastingHTML(pageHolder.get(), unsafeContent); | 87 contentAfterPastingHTML(pageHolder.get(), unsafeContent); |
| 110 | 88 |
| 111 EXPECT_TRUE(sanitizedContent.contains("</a>")) << | 89 EXPECT_TRUE(sanitizedContent.contains("</a>")) << |
| 112 "We should have pasted *something*; the document is: " << | 90 "We should have pasted *something*; the document is: " << |
| 113 sanitizedContent.utf8().data(); | 91 sanitizedContent.utf8().data(); |
| 114 EXPECT_FALSE(sanitizedContent.contains(":alert()")) << | 92 EXPECT_FALSE(sanitizedContent.contains(":alert()")) << |
| 115 "The JavaScript URL is unsafe and should have been stripped; " | 93 "The JavaScript URL is unsafe and should have been stripped; " |
| 116 "instead: " << | 94 "instead: " << |
| 117 sanitizedContent.utf8().data(); | 95 sanitizedContent.utf8().data(); |
| 118 } | 96 } |
| 119 | 97 |
| 120 TEST( | 98 TEST( |
| 121 UnsafeSVGAttributeSanitizationTest, | 99 UnsafeSVGAttributeSanitizationTest, |
| 122 pasteAnchor_javaScriptHrefIsStripped_caseAndEntityInProtocol) | 100 pasteAnchor_javaScriptHrefIsStripped_caseAndEntityInProtocol) |
| 123 { | 101 { |
| 124 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); | 102 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); |
| 125 static const char unsafeContent[] = | 103 static const char unsafeContent[] = |
| 126 "<svg xmlns='http://www.w3.org/2000/svg' " | |
| 127 " width='1cm' height='1cm'>" | |
| 128 " <a href='jAvascriPT:alert()'></a>" | |
| 129 "</svg>"; | |
| 130 String sanitizedContent = | |
| 131 contentAfterPastingHTML(pageHolder.get(), unsafeContent); | |
| 132 | |
| 133 EXPECT_TRUE(sanitizedContent.contains("</a>")) << | |
| 134 "We should have pasted *something*; the document is: " << | |
| 135 sanitizedContent.utf8().data(); | |
| 136 EXPECT_FALSE(sanitizedContent.contains(":alert()")) << | |
| 137 "The JavaScript URL is unsafe and should have been stripped; " | |
| 138 "instead: " << | |
| 139 sanitizedContent.utf8().data(); | |
| 140 } | |
| 141 | |
| 142 TEST( | |
| 143 UnsafeSVGAttributeSanitizationTest, | |
| 144 pasteAnchor_javaScriptXlinkHrefIsStripped_caseAndEntityInProtocol) | |
| 145 { | |
| 146 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); | |
| 147 static const char unsafeContent[] = | |
| 148 "<svg xmlns='http://www.w3.org/2000/svg' " | 104 "<svg xmlns='http://www.w3.org/2000/svg' " |
| 149 " xmlns:xlink='http://www.w3.org/1999/xlink'" | 105 " xmlns:xlink='http://www.w3.org/1999/xlink'" |
| 150 " width='1cm' height='1cm'>" | 106 " width='1cm' height='1cm'>" |
| 151 " <a xlink:href='jAvascriPT:alert()'></a>" | 107 " <a xlink:href='jAvascriPT:alert()'></a>" |
| 152 "</svg>"; | 108 "</svg>"; |
| 153 String sanitizedContent = | 109 String sanitizedContent = |
| 154 contentAfterPastingHTML(pageHolder.get(), unsafeContent); | 110 contentAfterPastingHTML(pageHolder.get(), unsafeContent); |
| 155 | 111 |
| 156 EXPECT_TRUE(sanitizedContent.contains("</a>")) << | 112 EXPECT_TRUE(sanitizedContent.contains("</a>")) << |
| 157 "We should have pasted *something*; the document is: " << | 113 "We should have pasted *something*; the document is: " << |
| 158 sanitizedContent.utf8().data(); | 114 sanitizedContent.utf8().data(); |
| 159 EXPECT_FALSE(sanitizedContent.contains(":alert()")) << | 115 EXPECT_FALSE(sanitizedContent.contains(":alert()")) << |
| 160 "The JavaScript URL is unsafe and should have been stripped; " | 116 "The JavaScript URL is unsafe and should have been stripped; " |
| 161 "instead: " << | 117 "instead: " << |
| 162 sanitizedContent.utf8().data(); | 118 sanitizedContent.utf8().data(); |
| 163 } | 119 } |
| 164 | 120 |
| 165 TEST( | 121 TEST( |
| 166 UnsafeSVGAttributeSanitizationTest, | 122 UnsafeSVGAttributeSanitizationTest, |
| 167 pasteAnchor_javaScriptHrefIsStripped_entityWithoutSemicolonInProtocol) | 123 pasteAnchor_javaScriptHrefIsStripped_entityWithoutSemicolonInProtocol) |
| 168 { | 124 { |
| 169 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); | 125 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); |
| 170 static const char unsafeContent[] = | 126 static const char unsafeContent[] = |
| 171 "<svg xmlns='http://www.w3.org/2000/svg' " | 127 "<svg xmlns='http://www.w3.org/2000/svg' " |
| 172 " width='1cm' height='1cm'>" | |
| 173 " <a href='javascript:alert()'></a>" | |
| 174 "</svg>"; | |
| 175 String sanitizedContent = | |
| 176 contentAfterPastingHTML(pageHolder.get(), unsafeContent); | |
| 177 | |
| 178 EXPECT_TRUE(sanitizedContent.contains("</a>")) << | |
| 179 "We should have pasted *something*; the document is: " << | |
| 180 sanitizedContent.utf8().data(); | |
| 181 EXPECT_FALSE(sanitizedContent.contains(":alert()")) << | |
| 182 "The JavaScript URL is unsafe and should have been stripped; " | |
| 183 "instead: " << | |
| 184 sanitizedContent.utf8().data(); | |
| 185 } | |
| 186 | |
| 187 TEST( | |
| 188 UnsafeSVGAttributeSanitizationTest, | |
| 189 pasteAnchor_javaScriptXlinkHrefIsStripped_entityWithoutSemicolonInProtocol) | |
| 190 { | |
| 191 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); | |
| 192 static const char unsafeContent[] = | |
| 193 "<svg xmlns='http://www.w3.org/2000/svg' " | |
| 194 " xmlns:xlink='http://www.w3.org/1999/xlink'" | 128 " xmlns:xlink='http://www.w3.org/1999/xlink'" |
| 195 " width='1cm' height='1cm'>" | 129 " width='1cm' height='1cm'>" |
| 196 " <a xlink:href='javascript:alert()'></a>" | 130 " <a xlink:href='javascript:alert()'></a>" |
| 197 "</svg>"; | 131 "</svg>"; |
| 198 String sanitizedContent = | 132 String sanitizedContent = |
| 199 contentAfterPastingHTML(pageHolder.get(), unsafeContent); | 133 contentAfterPastingHTML(pageHolder.get(), unsafeContent); |
| 200 | 134 |
| 201 EXPECT_TRUE(sanitizedContent.contains("</a>")) << | 135 EXPECT_TRUE(sanitizedContent.contains("</a>")) << |
| 202 "We should have pasted *something*; the document is: " << | 136 "We should have pasted *something*; the document is: " << |
| 203 sanitizedContent.utf8().data(); | 137 sanitizedContent.utf8().data(); |
| 204 EXPECT_FALSE(sanitizedContent.contains(":alert()")) << | 138 EXPECT_FALSE(sanitizedContent.contains(":alert()")) << |
| 205 "The JavaScript URL is unsafe and should have been stripped; " | 139 "The JavaScript URL is unsafe and should have been stripped; " |
| 206 "instead: " << | 140 "instead: " << |
| 207 sanitizedContent.utf8().data(); | 141 sanitizedContent.utf8().data(); |
| 208 } | 142 } |
| 209 | 143 |
| 210 // Other sanitization integration tests are layout tests that use | 144 // Other sanitization integration tests are layout tests that use |
| 211 // document.execCommand('Copy') to source content that they later | 145 // document.execCommand('Copy') to source content that they later |
| 212 // paste. However SVG animation elements are not serialized when | 146 // paste. However SVG animation elements are not serialized when |
| 213 // copying, which means we can't test sanitizing these attributes in | 147 // copying, which means we can't test sanitizing these attributes in |
| 214 // layout tests: there is nowhere to source the unsafe content from. | 148 // layout tests: there is nowhere to source the unsafe content from. |
| 215 TEST( | 149 TEST( |
| 216 UnsafeSVGAttributeSanitizationTest, | 150 UnsafeSVGAttributeSanitizationTest, |
| 217 pasteAnimatedAnchor_javaScriptHrefIsStripped_caseAndEntityInProtocol) | 151 pasteAnimatedAnchor_javaScriptHrefIsStripped_caseAndEntityInProtocol) |
| 218 { | 152 { |
| 219 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); | 153 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); |
| 220 static const char unsafeContent[] = | 154 static const char unsafeContent[] = |
| 221 "<svg xmlns='http://www.w3.org/2000/svg' " | |
| 222 " width='1cm' height='1cm'>" | |
| 223 " <a href='https://www.google.com/'>" | |
| 224 " <animate attributeName='href' values='evil;JaVaSCRIpT:alert()'>
" | |
| 225 " </a>" | |
| 226 "</svg>"; | |
| 227 String sanitizedContent = | |
| 228 contentAfterPastingHTML(pageHolder.get(), unsafeContent); | |
| 229 | |
| 230 EXPECT_TRUE(sanitizedContent.contains("<a href=\"https://www.goo")) << | |
| 231 "We should have pasted *something*; the document is: " << | |
| 232 sanitizedContent.utf8().data(); | |
| 233 EXPECT_FALSE(sanitizedContent.contains(":alert()")) << | |
| 234 "The JavaScript URL is unsafe and should have been stripped; " | |
| 235 "instead: " << | |
| 236 sanitizedContent.utf8().data(); | |
| 237 } | |
| 238 | |
| 239 TEST( | |
| 240 UnsafeSVGAttributeSanitizationTest, | |
| 241 pasteAnimatedAnchor_javaScriptXlinkHrefIsStripped_caseAndEntityInProtocol) | |
| 242 { | |
| 243 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(1, 1)); | |
| 244 static const char unsafeContent[] = | |
| 245 "<svg xmlns='http://www.w3.org/2000/svg' " | 155 "<svg xmlns='http://www.w3.org/2000/svg' " |
| 246 " xmlns:xlink='http://www.w3.org/1999/xlink'" | 156 " xmlns:xlink='http://www.w3.org/1999/xlink'" |
| 247 " width='1cm' height='1cm'>" | 157 " width='1cm' height='1cm'>" |
| 248 " <a xlink:href='https://www.google.com/'>" | 158 " <a xlink:href='https://www.google.com/'>" |
| 249 " <animate xmlns:ng='http://www.w3.org/1999/xlink' " | 159 " <animate xmlns:ng='http://www.w3.org/1999/xlink' " |
| 250 " attributeName='ng:href' values='evil;JaVaSCRIpT:alert(
)'>" | 160 " attributeName='ng:href' values='evil;JaVaSCRIpT:alert(
)'>" |
| 251 " </a>" | 161 " </a>" |
| 252 "</svg>"; | 162 "</svg>"; |
| 253 String sanitizedContent = | 163 String sanitizedContent = |
| 254 contentAfterPastingHTML(pageHolder.get(), unsafeContent); | 164 contentAfterPastingHTML(pageHolder.get(), unsafeContent); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 274 RefPtrWillBeRawPtr<Document> document = Document::create(); | 184 RefPtrWillBeRawPtr<Document> document = Document::create(); |
| 275 RefPtrWillBeRawPtr<SVGElement> target = SVGAElement::create(*document); | 185 RefPtrWillBeRawPtr<SVGElement> target = SVGAElement::create(*document); |
| 276 RefPtrWillBeRawPtr<SVGAnimateElement> element = SVGAnimateElement::create(*d
ocument); | 186 RefPtrWillBeRawPtr<SVGAnimateElement> element = SVGAnimateElement::create(*d
ocument); |
| 277 element->setTargetElement(target.get()); | 187 element->setTargetElement(target.get()); |
| 278 element->setAttributeName(XLinkNames::hrefAttr); | 188 element->setAttributeName(XLinkNames::hrefAttr); |
| 279 | 189 |
| 280 // Sanity check that xlink:href was identified as a "string" attribute | 190 // Sanity check that xlink:href was identified as a "string" attribute |
| 281 EXPECT_EQ(AnimatedString, element->animatedPropertyType()); | 191 EXPECT_EQ(AnimatedString, element->animatedPropertyType()); |
| 282 | 192 |
| 283 EXPECT_FALSE(element->animatedPropertyTypeSupportsAddition()); | 193 EXPECT_FALSE(element->animatedPropertyTypeSupportsAddition()); |
| 284 | |
| 285 element->setAttributeName(SVGNames::hrefAttr); | |
| 286 | |
| 287 // Sanity check that href was identified as a "string" attribute | |
| 288 EXPECT_EQ(AnimatedString, element->animatedPropertyType()); | |
| 289 | |
| 290 EXPECT_FALSE(element->animatedPropertyTypeSupportsAddition()); | |
| 291 } | 194 } |
| 292 | 195 |
| 293 TEST( | 196 TEST( |
| 294 UnsafeSVGAttributeSanitizationTest, | 197 UnsafeSVGAttributeSanitizationTest, |
| 295 stripScriptingAttributes_animateElement) | 198 stripScriptingAttributes_animateElement) |
| 296 { | 199 { |
| 297 Vector<Attribute> attributes; | 200 Vector<Attribute> attributes; |
| 298 attributes.append(Attribute(XLinkNames::hrefAttr, "javascript:alert()")); | 201 attributes.append(Attribute(XLinkNames::hrefAttr, "javascript:alert()")); |
| 299 attributes.append(Attribute(SVGNames::hrefAttr, "javascript:alert()")); | |
| 300 attributes.append(Attribute(SVGNames::fromAttr, "/home")); | 202 attributes.append(Attribute(SVGNames::fromAttr, "/home")); |
| 301 attributes.append(Attribute(SVGNames::toAttr, "javascript:own3d()")); | 203 attributes.append(Attribute(SVGNames::toAttr, "javascript:own3d()")); |
| 302 | 204 |
| 303 RefPtrWillBeRawPtr<Document> document = Document::create(); | 205 RefPtrWillBeRawPtr<Document> document = Document::create(); |
| 304 RefPtrWillBeRawPtr<Element> element = SVGAnimateElement::create(*document); | 206 RefPtrWillBeRawPtr<Element> element = SVGAnimateElement::create(*document); |
| 305 element->stripScriptingAttributes(attributes); | 207 element->stripScriptingAttributes(attributes); |
| 306 | 208 |
| 307 EXPECT_EQ(3ul, attributes.size()) << | 209 EXPECT_EQ(2ul, attributes.size()) << |
| 308 "One of the attributes should have been stripped."; | 210 "One of the attributes should have been stripped."; |
| 309 EXPECT_EQ(XLinkNames::hrefAttr, attributes[0].name()) << | 211 EXPECT_EQ(XLinkNames::hrefAttr, attributes[0].name()) << |
| 310 "The 'xlink:href' attribute should not have been stripped from " | 212 "The 'xlink:href' attribute should not have been stripped from " |
| 311 "<animate> because it is not a URL attribute of <animate>."; | 213 "<animate> because it is not a URL attribute of <animate>."; |
| 312 EXPECT_EQ(SVGNames::hrefAttr, attributes[1].name()) << | 214 EXPECT_EQ(SVGNames::fromAttr, attributes[1].name()) << |
| 313 "The 'href' attribute should not have been stripped from " | |
| 314 "<animate> because it is not a URL attribute of <animate>."; | |
| 315 EXPECT_EQ(SVGNames::fromAttr, attributes[2].name()) << | |
| 316 "The 'from' attribute should not have been strippef from <animate> " | 215 "The 'from' attribute should not have been strippef from <animate> " |
| 317 "because its value is innocuous."; | 216 "because its value is innocuous."; |
| 318 } | 217 } |
| 319 | 218 |
| 320 TEST( | 219 TEST( |
| 321 UnsafeSVGAttributeSanitizationTest, | |
| 322 isJavaScriptURLAttribute_hrefContainingJavascriptURL) | |
| 323 { | |
| 324 Attribute attribute(SVGNames::hrefAttr, "javascript:alert()"); | |
| 325 RefPtrWillBeRawPtr<Document> document = Document::create(); | |
| 326 RefPtrWillBeRawPtr<Element> element = SVGAElement::create(*document); | |
| 327 EXPECT_TRUE( | |
| 328 element->isJavaScriptURLAttribute(attribute)) << | |
| 329 "The 'a' element should identify an 'href' attribute with a " | |
| 330 "JavaScript URL value as a JavaScript URL attribute"; | |
| 331 } | |
| 332 | |
| 333 TEST( | |
| 334 UnsafeSVGAttributeSanitizationTest, | 220 UnsafeSVGAttributeSanitizationTest, |
| 335 isJavaScriptURLAttribute_xlinkHrefContainingJavascriptURL) | 221 isJavaScriptURLAttribute_xlinkHrefContainingJavascriptURL) |
| 336 { | 222 { |
| 337 Attribute attribute(XLinkNames::hrefAttr, "javascript:alert()"); | 223 Attribute attribute(XLinkNames::hrefAttr, "javascript:alert()"); |
| 338 RefPtrWillBeRawPtr<Document> document = Document::create(); | 224 RefPtrWillBeRawPtr<Document> document = Document::create(); |
| 339 RefPtrWillBeRawPtr<Element> element = SVGAElement::create(*document); | 225 RefPtrWillBeRawPtr<Element> element = SVGAElement::create(*document); |
| 340 EXPECT_TRUE( | 226 EXPECT_TRUE( |
| 341 element->isJavaScriptURLAttribute(attribute)) << | 227 element->isJavaScriptURLAttribute(attribute)) << |
| 342 "The 'a' element should identify an 'xlink:href' attribute with a " | 228 "The 'a' element should identify an 'xlink:href' attribute with a " |
| 343 "JavaScript URL value as a JavaScript URL attribute"; | 229 "JavaScript URL value as a JavaScript URL attribute"; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 Attribute fineAttribute(SVGNames::fromAttr, "hello, world!"); | 291 Attribute fineAttribute(SVGNames::fromAttr, "hello, world!"); |
| 406 RefPtrWillBeRawPtr<Document> document = Document::create(); | 292 RefPtrWillBeRawPtr<Document> document = Document::create(); |
| 407 RefPtrWillBeRawPtr<Element> element = SVGSetElement::create(*document); | 293 RefPtrWillBeRawPtr<Element> element = SVGSetElement::create(*document); |
| 408 EXPECT_FALSE( | 294 EXPECT_FALSE( |
| 409 element->isSVGAnimationAttributeSettingJavaScriptURL(fineAttribute)) << | 295 element->isSVGAnimationAttributeSettingJavaScriptURL(fineAttribute)) << |
| 410 "The animate element should not identify a 'from' attribute with an " | 296 "The animate element should not identify a 'from' attribute with an " |
| 411 "innocuous value as setting a JavaScript URL."; | 297 "innocuous value as setting a JavaScript URL."; |
| 412 } | 298 } |
| 413 | 299 |
| 414 } // namespace blink | 300 } // namespace blink |
| OLD | NEW |