Skip to content
Permalink
Browse files
Rename attributeContainsJavascriptURL to attributeContainsJavaScriptURL
https://bugs.webkit.org/show_bug.cgi?id=241872

Reviewed by Wenson Hsieh.

with a capital S

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::attributeContainsJavaScriptURL const):
(WebCore::Element::stripScriptingAttributes const):
(WebCore::Element::attributeContainsJavascriptURL const): Deleted.
* Source/WebCore/dom/Element.h:
* Source/WebCore/editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::removeContentsWithSideEffects):
* Source/WebCore/editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendStartTag):
* Source/WebCore/svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::attributeContainsJavaScriptURL const):
(WebCore::SVGAnimationElement::attributeContainsJavascriptURL const): Deleted.
* Source/WebCore/svg/SVGAnimationElement.h:

Canonical link: https://commits.webkit.org/251755@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
nt1m committed Jun 22, 2022
1 parent e840e34 commit b308d25de831f4b7d9c1d643fd166417ef4a5c5e
Showing 6 changed files with 8 additions and 8 deletions.
@@ -2315,7 +2315,7 @@ bool Element::isEventHandlerAttribute(const Attribute& attribute) const
return attribute.name().namespaceURI().isNull() && attribute.name().localName().startsWith("on"_s);
}

bool Element::attributeContainsJavascriptURL(const Attribute& attribute) const
bool Element::attributeContainsJavaScriptURL(const Attribute& attribute) const
{
return isURLAttribute(attribute) && WTF::protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(attribute.value()));
}
@@ -2324,7 +2324,7 @@ void Element::stripScriptingAttributes(Vector<Attribute>& attributeVector) const
{
attributeVector.removeAllMatching([this](auto& attribute) -> bool {
return this->isEventHandlerAttribute(attribute)
|| this->attributeContainsJavascriptURL(attribute)
|| this->attributeContainsJavaScriptURL(attribute)
|| this->isHTMLContentAttribute(attribute);
});
}
@@ -294,7 +294,7 @@ class Element : public ContainerNode {
void parserSetAttributes(const Vector<Attribute>&);

bool isEventHandlerAttribute(const Attribute&) const;
virtual bool attributeContainsJavascriptURL(const Attribute&) const;
virtual bool attributeContainsJavaScriptURL(const Attribute&) const;

// Remove attributes that might introduce scripting from the vector leaving the element unchanged.
void stripScriptingAttributes(Vector<Attribute>&) const;
@@ -238,7 +238,7 @@ void ReplacementFragment::removeContentsWithSideEffects()
}
if (element->hasAttributes()) {
for (auto& attribute : element->attributesIterator()) {
if (element->isEventHandlerAttribute(attribute) || element->attributeContainsJavascriptURL(attribute))
if (element->isEventHandlerAttribute(attribute) || element->attributeContainsJavaScriptURL(attribute))
attributesToRemove.append({ element.copyRef(), attribute.name() });
}
}
@@ -556,7 +556,7 @@ void StyledMarkupAccumulator::appendStartTag(StringBuilder& out, const Element&
// We'll handle the style attribute separately, below.
if (attribute.name() == styleAttr && shouldOverrideStyleAttr)
continue;
if (element.isEventHandlerAttribute(attribute) || element.attributeContainsJavascriptURL(attribute))
if (element.isEventHandlerAttribute(attribute) || element.attributeContainsJavaScriptURL(attribute))
continue;
#if ENABLE(DATA_DETECTION)
if (replacementType == SpanReplacementType::DataDetector && DataDetection::isDataDetectorAttribute(attribute.name()))
@@ -148,7 +148,7 @@ bool SVGAnimationElement::isSupportedAttribute(const QualifiedName& attrName)
return supportedAttributes.get().contains<SVGAttributeHashTranslator>(attrName);
}

bool SVGAnimationElement::attributeContainsJavascriptURL(const Attribute& attribute) const
bool SVGAnimationElement::attributeContainsJavaScriptURL(const Attribute& attribute) const
{
if (attribute.name() == SVGNames::fromAttr || attribute.name() == SVGNames::toAttr)
return WTF::protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(attribute.value()));
@@ -160,7 +160,7 @@ bool SVGAnimationElement::attributeContainsJavascriptURL(const Attribute& attrib
}
return false;
}
return Element::attributeContainsJavascriptURL(attribute);
return Element::attributeContainsJavaScriptURL(attribute);
}

void SVGAnimationElement::parseAttribute(const QualifiedName& name, const AtomString& value)
@@ -88,7 +88,7 @@ class SVGAnimationElement : public SVGSMILElement, public SVGTests {
virtual void resetAnimation();

static bool isSupportedAttribute(const QualifiedName&);
bool attributeContainsJavascriptURL(const Attribute&) const final;
bool attributeContainsJavaScriptURL(const Attribute&) const final;
void parseAttribute(const QualifiedName&, const AtomString&) override;
void svgAttributeChanged(const QualifiedName&) override;

0 comments on commit b308d25

Please sign in to comment.