Skip to content

Allow more characters when creating various nodes#1079

Merged
domenic merged 6 commits intomainfrom
createelement-chars
Jun 9, 2025
Merged

Allow more characters when creating various nodes#1079
domenic merged 6 commits intomainfrom
createelement-chars

Conversation

@domenic
Copy link
Copy Markdown
Member

@domenic domenic commented May 5, 2022

Stop using XML grammar productions for validating element, attribute, and doctype names. These were overly-restrictive, as it is possible to create nodes with names that don't match those productions using the HTML parser. After this change, each construct has its own custom name validation algorithm.

The only remaining dependency on XML naming rules is for processing instructions, which are uncommon and cannot be created with the HTML parser anyway.

Closes #769. Closes #849. Closes #1373.

(See WHATWG Working Mode: Changes for more details.)


Original points for discussion, discussed and concluded on in following comments. These do not reflect the currently proposed change.
  • I did not disallow = inside attribute local names. Both the parser and DOM APIs currently disallow them, except the parser allows it for the first character. I'm happy to change this if people prefer; I started with the simpler version.
  • This does not disallow lone surrogates, the Unicode replacement character U+FFFD, single quotes, or < in any position, because the HTML parser allows introducing those already and it seems nicer to align.
  • I did not change validation for createProcessingInstruction() or createDocumentType(). We could try to simplify those too, perhaps after investigating parser behavior. But they didn't seem to be causing any real web developer pain, unlike elements and local names, so I thought it'd be better to just leave them as-is.

Preview | Diff

Copy link
Copy Markdown
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to call out the = difference in a note? At least a comment would be good I think.

I'm not a big fan of adding "DOM API" to the naming. That makes more sense if this was defined outside of the DOM Standard itself. I think dropping it would still make everything work.

Comment thread dom.bs Outdated
Copy link
Copy Markdown
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good to me, modulo a small oversight. Anyone else that should review this? @mfreed7 perhaps?

Comment thread dom.bs Outdated
@domenic domenic requested a review from mfreed7 May 18, 2022 16:47
Copy link
Copy Markdown
Contributor

@mfreed7 mfreed7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Comment thread dom.bs Outdated
Comment thread dom.bs Outdated
@domenic
Copy link
Copy Markdown
Member Author

domenic commented Jun 2, 2022

Discussed equals sign at HTML triage meeting. Conclusion: disallow it in attributes everywhere. (Even though the parser allows it in the first-character position.)

@domenic
Copy link
Copy Markdown
Member Author

domenic commented Jun 6, 2022

I think this is ready for re-review.

Potential issue: XML's definition of Char seems nonsensical (it excludes various Unicode characters below U+0020). And, its definition of the [^#x00#x09#x0A#0x0Cx0D#x20/>] syntax depends on that definition. Hmm.

@domenic
Copy link
Copy Markdown
Member Author

domenic commented Jun 7, 2022

Refined to no longer use EBNF.

domenic added a commit to whatwg/html that referenced this pull request Jun 7, 2022
Copy link
Copy Markdown
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem equivalent to the sorta-EBNF from before. In particular if the first code point is from BeyondHTMLParserName the second code point was more limited.

Comment thread dom.bs Outdated
Comment thread dom.bs Outdated
@domenic
Copy link
Copy Markdown
Member Author

domenic commented Jun 7, 2022

In particular if the first code point is from BeyondHTMLParserName the second code point was more limited.

I'm not sure exactly what you mean. Recall that it's a union of both. The second+ code point is from HTMLParserCompatibleName, which had [^#x00#x09#x0A#0x0Cx0D#x20/>]* for that position. Which is exactly what the current draft says, right?

@annevk
Copy link
Copy Markdown
Member

annevk commented Jun 7, 2022

I don't think the EBNF allows for the second code point to be U+0001 when the first is :, for instance. At least the intent was to prevent that. Does EBNF work completely differently from ABNF in that | doesn't signify OR but instead "union"?

(I didn't see "An equivalent EBNF is the following" initially and I don't think what it states is correct.)

@domenic
Copy link
Copy Markdown
Member Author

domenic commented Jun 7, 2022

I see, I did not capture that this was a branching scenario depending on the behavior of the first code point. And you addressed what harms names like that might hypothetically cause in #849 (comment) .

I'll revise.

@domenic
Copy link
Copy Markdown
Member Author

domenic commented Jun 7, 2022

I think that is done. The other way I could write this is by looping over the characters individually, which is what a performant implementation would do (instead of using lots of O(n) "contains" operations). But I think this is relatively clear.

(Edit: well, a performant implementation would be looping over code units, since that's JS's native string format... which feels ickier to spec.)

Copy link
Copy Markdown
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks accurate to me.

Comment thread dom.bs Outdated
@domenic
Copy link
Copy Markdown
Member Author

domenic commented Jun 8, 2022

OK, this (and whatwg/html#7991) is just waiting on someone to write web platform tests. Then we can close a ~5 year old recurring pain point on the web platform!

For fun, these are all the references to this I can find:

I suspect there are more GitHub issues from earlier, because why would I have posted #449 if not because of some other issue someone filed? But I couldn't find them.

@zcorpan zcorpan added the needs tests Moving the issue forward requires someone to write tests label Jun 8, 2022
@annevk
Copy link
Copy Markdown
Member

annevk commented Feb 14, 2023

@josepharhar would you be interested in finishing this?

@josepharhar
Copy link
Copy Markdown
Contributor

Yes, I have started a WPT here: web-platform-tests/wpt#38503

@annevk
Copy link
Copy Markdown
Member

annevk commented Feb 15, 2023

\o/ I suspect that once you implement this and do a try run you'll find a lot of existing WPT tests that can be adjusted. There's probably no need for a new file, but maybe.

@cdumez
Copy link
Copy Markdown

cdumez commented May 5, 2023

Any progress on this?

@josepharhar
Copy link
Copy Markdown
Contributor

Not recently, I have unfortunately been focused on other stuff.

sideshowbarker added a commit to sideshowbarker/WebKit that referenced this pull request Jan 12, 2026
https://bugs.webkit.org/show_bug.cgi?id=241419

Reviewed by NOBODY (OOPS!).

Implement relaxed name-validation rules per whatwg/dom#1079, whatwg/html#7991,
and whatwg/html#11453. This aligns DOM API name behavior with HTML parser behavior —
which has always allowed a wider range of characters in element and attribute names.

New validation functions in NameValidation.h/cpp:

- isValidElementName(): For createElement — allows [A-Za-z] start followed by
  any char except null/whitespace/>//, or [:_>=0x80] start with restricted continuation
- isValidAttributeName(): For setAttribute/toggleAttribute/createAttribute —
  no null, whitespace, /, >, or =
- isValidNamespacePrefix(): For *NS methods — no null, whitespace, /, or >
- isValidDoctypeName(): For createDocumentType — no null, whitespace, or >
- isValidXMLName(): Preserves old XML Name production for createProcessingInstruction

* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType):
* Source/WebCore/dom/Document.cpp:
(WebCore::isValidHTMLElementName):
(WebCore::Document::createElement):
(WebCore::Document::createProcessingInstruction):
(WebCore::Document::createElementNS):
(WebCore::parseQualifiedName):
(WebCore::Document::parseQualifiedAttributeName):
(WebCore::Document::createAttribute):
(WebCore::Document::createAttributeNS):
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::toggleAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::parseAttributeName):
* Source/WebCore/dom/NameValidation.cpp: Added.
(WebCore::NameValidation::isValidElementName):
(WebCore::NameValidation::isValidAttributeName):
(WebCore::NameValidation::isValidNamespacePrefix):
(WebCore::NameValidation::isValidDoctypeName):
(WebCore::NameValidation::isValidXMLName):
* Source/WebCore/dom/NameValidation.h: Added.
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::checkSetPrefix):
* Source/WebCore/dom/messageports/WorkerMessagePortChannelProvider.h:
* Source/WebCore/editing/EditorCommand.cpp:
(WebCore::executeFormatBlock):
* Source/WebCore/svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName):
lando-worker bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Jan 15, 2026
…efixes r=smaug,dom-core,devtools-reviewers,ochameau

Implement "relaxed" element/attribute name-validation rules, per:

- whatwg/dom#1079
- whatwg/html#7991
- whatwg/html#11453

That aligns DOM-API name behavior with HTML parser behavior - which has
always allowed a wider range of characters in element and attribute names.

New validation functions in nsContentUtils:

- IsValidElementLocalName(): For createElement - allows [A-Za-z] start followed by
  any char except null/whitespace/>//, or [:_>=0x80] start with restricted continuation
- IsValidAttributeName(): For setAttribute/toggleAttribute/createAttribute -
  no null, whitespace, /, >, or =
- IsValidNamespacePrefix(): For *NS methods - no null, whitespace, /, or >
- IsValidDoctypeName(): For createDocumentType - no null, whitespace, or >
- ParseQualifiedNameRelaxed(): Validates and parses qualified names with relaxed rules

ParseQualifiedNameRelaxed() correctly implements the "strictly split" algorithm
per the DOM spec: for qualified names with multiple colons like "f:o:o", the
local name is just the second token ("o"), not everything after the first colon
("o:o"). This matches the spec's requirement to split on all colons and use only
splitResult[0] as prefix and splitResult[1] as localName.

Deleted outdated DOM Level 1 mochitest tests that tested old XML-based name
validation rules; WPT name-validation.html provides coverage for the new
relaxed rules. Removed WPT expected-failure .ini files, since all tests now pass.

Differential Revision: https://phabricator.services.mozilla.com/D277822
lando-worker bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Feb 18, 2026
…efixes r=smaug,dom-core,devtools-reviewers,ochameau

Implement "relaxed" element/attribute name-validation rules, per:

- whatwg/dom#1079
- whatwg/html#7991
- whatwg/html#11453

That aligns DOM-API name behavior with HTML parser behavior - which has
always allowed a wider range of characters in element and attribute names.

New validation functions in nsContentUtils:

- IsValidElementLocalName(): For createElement - allows [A-Za-z] start followed by
  any char except null/whitespace/>//, or [:_>=0x80] start with restricted continuation
- IsValidAttributeName(): For setAttribute/toggleAttribute/createAttribute -
  no null, whitespace, /, >, or =
- IsValidNamespacePrefix(): For *NS methods - no null, whitespace, /, or >
- IsValidDoctypeName(): For createDocumentType - no null, whitespace, or >
- ParseQualifiedNameRelaxed(): Validates and parses qualified names with relaxed rules

ParseQualifiedNameRelaxed() correctly implements the "strictly split" algorithm
per the DOM spec: for qualified names with multiple colons like "f:o:o", the
local name is just the second token ("o"), not everything after the first colon
("o:o"). This matches the spec's requirement to split on all colons and use only
splitResult[0] as prefix and splitResult[1] as localName.

Deleted outdated DOM Level 1 mochitest tests that tested old XML-based name
validation rules; WPT name-validation.html provides coverage for the new
relaxed rules. Removed WPT expected-failure .ini files, since all tests now pass.

Differential Revision: https://phabricator.services.mozilla.com/D277822
lando-worker bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Feb 19, 2026
…efixes r=smaug,dom-core,devtools-reviewers,ochameau

Implement "relaxed" element/attribute name-validation rules, per:

- whatwg/dom#1079
- whatwg/html#7991
- whatwg/html#11453

That aligns DOM-API name behavior with HTML parser behavior - which has
always allowed a wider range of characters in element and attribute names.

New validation functions in nsContentUtils:

- IsValidElementLocalName(): For createElement - allows [A-Za-z] start followed by
  any char except null/whitespace/>//, or [:_>=0x80] start with restricted continuation
- IsValidAttributeName(): For setAttribute/toggleAttribute/createAttribute -
  no null, whitespace, /, >, or =
- IsValidNamespacePrefix(): For *NS methods - no null, whitespace, /, or >
- IsValidDoctypeName(): For createDocumentType - no null, whitespace, or >
- ParseQualifiedNameRelaxed(): Validates and parses qualified names with relaxed rules

ParseQualifiedNameRelaxed() correctly implements the "strictly split" algorithm
per the DOM spec: for qualified names with multiple colons like "f:o:o", the
local name is just the second token ("o"), not everything after the first colon
("o:o"). This matches the spec's requirement to split on all colons and use only
splitResult[0] as prefix and splitResult[1] as localName.

Deleted outdated DOM Level 1 mochitest tests that tested old XML-based name
validation rules; WPT name-validation.html provides coverage for the new
relaxed rules. Removed WPT expected-failure .ini files, since all tests now pass.

Differential Revision: https://phabricator.services.mozilla.com/D277822
sideshowbarker added a commit to sideshowbarker/WebKit that referenced this pull request Mar 3, 2026
https://bugs.webkit.org/show_bug.cgi?id=241419

Reviewed by NOBODY (OOPS!).

Implement relaxed name-validation rules per whatwg/dom#1079, whatwg/html#7991,
and whatwg/html#11453. This aligns DOM API name behavior with HTML parser behavior —
which has always allowed a wider range of characters in element and attribute names.

New validation functions in NameValidation.h/cpp:

- isValidElementName(): For createElement — allows [A-Za-z] start followed by
  any char except null/whitespace/>//, or [:_>=0x80] start with restricted continuation
- isValidAttributeName(): For setAttribute/toggleAttribute/createAttribute —
  no null, whitespace, /, >, or =
- isValidNamespacePrefix(): For *NS methods — no null, whitespace, /, or >
- isValidDoctypeName(): For createDocumentType — no null, whitespace, or >
- isValidXMLName(): Preserves old XML Name production for createProcessingInstruction

* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType):
* Source/WebCore/dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
(WebCore::Document::createElementForBindings):
(WebCore::Document::createProcessingInstruction):
(WebCore::Document::createElementNS):
(WebCore::Document::createAttribute):
(WebCore::Document::createAttributeNS):
(WebCore::isValidNameStart): Deleted.
(WebCore::isValidNamePart): Deleted.
(WebCore::isValidHTMLElementName):
(WebCore::Document::hasValidNamespaceForElements): Deleted.
(WebCore::Document::hasValidNamespaceForAttributes): Deleted.
(WebCore::isValidNameNonASCII): Deleted.
(WebCore::isValidNameASCII): Deleted.
(WebCore::isValidNameASCIIWithoutColon): Deleted.
(WebCore::Document::isValidName): Deleted.
(WebCore::Document::parseQualifiedName): Deleted.
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::toggleAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::setAttributeNS):
(WebCore::Element::parseAttributeName):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/NameValidation.cpp: Added.
(WebCore::NameValidation::isInvalidAttributeNameCharacter):
(WebCore::NameValidation::isInvalidElementNameCharacterAfterAlphaStart):
(WebCore::NameValidation::isValidElementNameContinuationCharacter):
(WebCore::NameValidation::isInvalidNamespacePrefixCharacter):
(WebCore::NameValidation::isInvalidDoctypeNameCharacter):
(WebCore::NameValidation::isValidElementName):
(WebCore::NameValidation::isValidAttributeName):
(WebCore::NameValidation::isValidNamespacePrefix):
(WebCore::NameValidation::isValidDoctypeName):
(WebCore::NameValidation::isValidASCIIXMLName):
(WebCore::NameValidation::isValidXMLNameStart):
(WebCore::NameValidation::isValidXMLNamePart):
(WebCore::NameValidation::isValidXMLName):
(WebCore::NameValidation::parseQualifiedNameToPair):
(WebCore::NameValidation::parseQualifiedElementName):
(WebCore::NameValidation::parseQualifiedAttributeName):
(WebCore::NameValidation::hasValidNamespaceForElements):
(WebCore::NameValidation::hasValidNamespaceForAttributes):
* Source/WebCore/dom/NameValidation.h: Added.
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::checkSetPrefix):
* Source/WebCore/dom/ProcessingInstruction.cpp:
* Source/WebCore/editing/EditorCommand.cpp:
(WebCore::executeFormatBlock):
* Source/WebCore/svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName const):
* Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::handleNamespaceAttributes):
(WebCore::handleElementAttributes):
sideshowbarker added a commit to sideshowbarker/WebKit that referenced this pull request Mar 4, 2026
https://bugs.webkit.org/show_bug.cgi?id=241419

Reviewed by NOBODY (OOPS!).

Implement relaxed name-validation rules per whatwg/dom#1079, whatwg/html#7991,
and whatwg/html#11453. This aligns DOM API name behavior with HTML parser behavior —
which has always allowed a wider range of characters in element and attribute names.

New validation functions in NameValidation.h/cpp:

- isValidElementName(): For createElement — allows [A-Za-z] start followed by
  any char except null/whitespace/>//, or [:_>=0x80] start with restricted continuation
- isValidAttributeName(): For setAttribute/toggleAttribute/createAttribute —
  no null, whitespace, /, >, or =
- isValidNamespacePrefix(): For *NS methods — no null, whitespace, /, or >
- isValidDoctypeName(): For createDocumentType — no null, whitespace, or >
- isValidXMLName(): Preserves old XML Name production for createProcessingInstruction

* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType):
* Source/WebCore/dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
(WebCore::Document::createElementForBindings):
(WebCore::Document::createProcessingInstruction):
(WebCore::Document::createElementNS):
(WebCore::Document::createAttribute):
(WebCore::Document::createAttributeNS):
(WebCore::isValidNameStart): Deleted.
(WebCore::isValidNamePart): Deleted.
(WebCore::isValidHTMLElementName):
(WebCore::Document::hasValidNamespaceForElements): Deleted.
(WebCore::Document::hasValidNamespaceForAttributes): Deleted.
(WebCore::isValidNameNonASCII): Deleted.
(WebCore::isValidNameASCII): Deleted.
(WebCore::isValidNameASCIIWithoutColon): Deleted.
(WebCore::Document::isValidName): Deleted.
(WebCore::Document::parseQualifiedName): Deleted.
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::toggleAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::setAttributeNS):
(WebCore::Element::parseAttributeName):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/NameValidation.cpp: Added.
(WebCore::NameValidation::isInvalidAttributeNameCharacter):
(WebCore::NameValidation::isInvalidElementNameCharacterAfterAlphaStart):
(WebCore::NameValidation::isValidElementNameContinuationCharacter):
(WebCore::NameValidation::isInvalidNamespacePrefixCharacter):
(WebCore::NameValidation::isInvalidDoctypeNameCharacter):
(WebCore::NameValidation::isValidElementName):
(WebCore::NameValidation::isValidAttributeName):
(WebCore::NameValidation::isValidNamespacePrefix):
(WebCore::NameValidation::isValidDoctypeName):
(WebCore::NameValidation::isValidASCIIXMLName):
(WebCore::NameValidation::isValidXMLNameStart):
(WebCore::NameValidation::isValidXMLNamePart):
(WebCore::NameValidation::isValidXMLName):
(WebCore::NameValidation::parseQualifiedNameToPair):
(WebCore::NameValidation::parseQualifiedElementName):
(WebCore::NameValidation::parseQualifiedAttributeName):
(WebCore::NameValidation::hasValidNamespaceForElements):
(WebCore::NameValidation::hasValidNamespaceForAttributes):
* Source/WebCore/dom/NameValidation.h: Added.
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::checkSetPrefix):
* Source/WebCore/dom/ProcessingInstruction.cpp:
* Source/WebCore/editing/EditorCommand.cpp:
(WebCore::executeFormatBlock):
* Source/WebCore/svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName const):
* Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::handleNamespaceAttributes):
(WebCore::handleElementAttributes):
sideshowbarker added a commit to sideshowbarker/WebKit that referenced this pull request Mar 4, 2026
https://bugs.webkit.org/show_bug.cgi?id=241419

Reviewed by NOBODY (OOPS!).

Implement relaxed name-validation rules per whatwg/dom#1079, whatwg/html#7991,
and whatwg/html#11453. This aligns DOM API name behavior with HTML parser behavior —
which has always allowed a wider range of characters in element and attribute names.

New validation functions in NameValidation.h/cpp:

- isValidElementName(): For createElement — allows [A-Za-z] start followed by
  any char except null/whitespace/>//, or [:_>=0x80] start with restricted continuation
- isValidAttributeName(): For setAttribute/toggleAttribute/createAttribute —
  no null, whitespace, /, >, or =
- isValidNamespacePrefix(): For *NS methods — no null, whitespace, /, or >
- isValidDoctypeName(): For createDocumentType — no null, whitespace, or >
- isValidXMLName(): Preserves old XML Name production for createProcessingInstruction

* LayoutTests/fast/dom/dataset-expected.txt:
* LayoutTests/fast/dom/dataset-xhtml-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument.html:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocumentType-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createAttribute-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS.html:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS.js:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/name-validation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/global-attributes/dataset-set-expected.txt:
* LayoutTests/platform/mac/http/tests/misc/acid3-expected.txt:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType):
* Source/WebCore/dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
(WebCore::Document::createElementForBindings):
(WebCore::Document::createProcessingInstruction):
(WebCore::Document::createElementNS):
(WebCore::Document::createAttribute):
(WebCore::Document::createAttributeNS):
(WebCore::isValidNameStart): Deleted.
(WebCore::isValidNamePart): Deleted.
(WebCore::isValidHTMLElementName):
(WebCore::Document::hasValidNamespaceForElements): Deleted.
(WebCore::Document::hasValidNamespaceForAttributes): Deleted.
(WebCore::isValidNameNonASCII): Deleted.
(WebCore::isValidNameASCII): Deleted.
(WebCore::isValidNameASCIIWithoutColon): Deleted.
(WebCore::Document::isValidName): Deleted.
(WebCore::Document::parseQualifiedName): Deleted.
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::toggleAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::setAttributeNS):
(WebCore::Element::parseAttributeName):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/NameValidation.cpp: Added.
(WebCore::NameValidation::isInvalidAttributeNameCharacter):
(WebCore::NameValidation::isInvalidElementNameCharacterAfterAlphaStart):
(WebCore::NameValidation::isValidElementNameContinuationCharacter):
(WebCore::NameValidation::isInvalidNamespacePrefixCharacter):
(WebCore::NameValidation::isInvalidDoctypeNameCharacter):
(WebCore::NameValidation::isValidElementName):
(WebCore::NameValidation::isValidAttributeName):
(WebCore::NameValidation::isValidNamespacePrefix):
(WebCore::NameValidation::isValidDoctypeName):
(WebCore::NameValidation::isValidASCIIXMLName):
(WebCore::NameValidation::isValidXMLNameStart):
(WebCore::NameValidation::isValidXMLNamePart):
(WebCore::NameValidation::isValidXMLName):
(WebCore::NameValidation::parseQualifiedNameToPair):
(WebCore::NameValidation::parseQualifiedElementName):
(WebCore::NameValidation::parseQualifiedAttributeName):
(WebCore::NameValidation::hasValidNamespaceForElements):
(WebCore::NameValidation::hasValidNamespaceForAttributes):
* Source/WebCore/dom/NameValidation.h: Added.
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::checkSetPrefix):
* Source/WebCore/dom/ProcessingInstruction.cpp:
* Source/WebCore/editing/EditorCommand.cpp:
(WebCore::executeFormatBlock):
* Source/WebCore/svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName const):
* Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::handleNamespaceAttributes):
(WebCore::handleElementAttributes):
sideshowbarker added a commit to sideshowbarker/WebKit that referenced this pull request Mar 4, 2026
https://bugs.webkit.org/show_bug.cgi?id=241419

Reviewed by NOBODY (OOPS!).

Implement relaxed name-validation rules per whatwg/dom#1079, whatwg/html#7991,
and whatwg/html#11453. This aligns DOM API name behavior with HTML parser behavior —
which has always allowed a wider range of characters in element and attribute names.

New validation functions in NameValidation.h/cpp:

- isValidElementName(): For createElement — allows [A-Za-z] start followed by
  any char except null/whitespace/>//, or [:_>=0x80] start with restricted continuation
- isValidAttributeName(): For setAttribute/toggleAttribute/createAttribute —
  no null, whitespace, /, >, or =
- isValidNamespacePrefix(): For *NS methods — no null, whitespace, /, or >
- isValidDoctypeName(): For createDocumentType — no null, whitespace, or >
- isValidXMLName(): Preserves old XML Name production for createProcessingInstruction

* LayoutTests/fast/dom/dataset-expected.txt:
* LayoutTests/fast/dom/dataset-xhtml-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument.html:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocumentType-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createAttribute-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS.html:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS.js:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/name-validation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/global-attributes/dataset-set-expected.txt:
* LayoutTests/platform/glib/http/tests/misc/acid3-expected.txt:
* LayoutTests/platform/mac/http/tests/misc/acid3-expected.txt:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType):
* Source/WebCore/dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
(WebCore::Document::createElementForBindings):
(WebCore::Document::createProcessingInstruction):
(WebCore::Document::createElementNS):
(WebCore::Document::createAttribute):
(WebCore::Document::createAttributeNS):
(WebCore::isValidNameStart): Deleted.
(WebCore::isValidNamePart): Deleted.
(WebCore::isValidHTMLElementName):
(WebCore::Document::hasValidNamespaceForElements): Deleted.
(WebCore::Document::hasValidNamespaceForAttributes): Deleted.
(WebCore::isValidNameNonASCII): Deleted.
(WebCore::isValidNameASCII): Deleted.
(WebCore::isValidNameASCIIWithoutColon): Deleted.
(WebCore::Document::isValidName): Deleted.
(WebCore::Document::parseQualifiedName): Deleted.
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::toggleAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::setAttributeNS):
(WebCore::Element::parseAttributeName):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/NameValidation.cpp: Added.
(WebCore::NameValidation::isInvalidAttributeNameCharacter):
(WebCore::NameValidation::isInvalidElementNameCharacterAfterAlphaStart):
(WebCore::NameValidation::isValidElementNameContinuationCharacter):
(WebCore::NameValidation::isInvalidNamespacePrefixCharacter):
(WebCore::NameValidation::isInvalidDoctypeNameCharacter):
(WebCore::NameValidation::isValidElementName):
(WebCore::NameValidation::isValidAttributeName):
(WebCore::NameValidation::isValidNamespacePrefix):
(WebCore::NameValidation::isValidDoctypeName):
(WebCore::NameValidation::isValidASCIIXMLName):
(WebCore::NameValidation::isValidXMLNameStart):
(WebCore::NameValidation::isValidXMLNamePart):
(WebCore::NameValidation::isValidXMLName):
(WebCore::NameValidation::parseQualifiedNameToPair):
(WebCore::NameValidation::parseQualifiedElementName):
(WebCore::NameValidation::parseQualifiedAttributeName):
(WebCore::NameValidation::hasValidNamespaceForElements):
(WebCore::NameValidation::hasValidNamespaceForAttributes):
* Source/WebCore/dom/NameValidation.h: Added.
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::checkSetPrefix):
* Source/WebCore/dom/ProcessingInstruction.cpp:
* Source/WebCore/editing/EditorCommand.cpp:
(WebCore::executeFormatBlock):
* Source/WebCore/svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName const):
* Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::handleNamespaceAttributes):
(WebCore::handleElementAttributes):
sideshowbarker added a commit to sideshowbarker/WebKit that referenced this pull request Mar 5, 2026
https://bugs.webkit.org/show_bug.cgi?id=241419

Reviewed by NOBODY (OOPS!).

Implement relaxed name-validation rules per whatwg/dom#1079, whatwg/html#7991,
and whatwg/html#11453. This aligns DOM API name behavior with HTML parser behavior —
which has always allowed a wider range of characters in element and attribute names.

New validation functions in NameValidation.h/cpp:

- isValidElementName(): For createElement — allows [A-Za-z] start followed by
  any char except null/whitespace/>//, or [:_>=0x80] start with restricted continuation
- isValidAttributeName(): For setAttribute/toggleAttribute/createAttribute —
  no null, whitespace, /, >, or =
- isValidNamespacePrefix(): For *NS methods — no null, whitespace, /, or >
- isValidDoctypeName(): For createDocumentType — no null, whitespace, or >
- isValidXMLName(): Preserves old XML Name production for createProcessingInstruction

* LayoutTests/fast/dom/dataset-expected.txt:
* LayoutTests/fast/dom/dataset-xhtml-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument.html:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocumentType-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createAttribute-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS.html:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS.js:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/name-validation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/global-attributes/dataset-set-expected.txt:
* LayoutTests/platform/glib/http/tests/misc/acid3-expected.txt:
* LayoutTests/platform/mac/http/tests/misc/acid3-expected.txt:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType):
* Source/WebCore/dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
(WebCore::Document::createElementForBindings):
(WebCore::Document::createProcessingInstruction):
(WebCore::Document::createElementNS):
(WebCore::Document::createAttribute):
(WebCore::Document::createAttributeNS):
(WebCore::isValidNameStart): Deleted.
(WebCore::isValidNamePart): Deleted.
(WebCore::isValidHTMLElementName):
(WebCore::Document::hasValidNamespaceForElements): Deleted.
(WebCore::Document::hasValidNamespaceForAttributes): Deleted.
(WebCore::isValidNameNonASCII): Deleted.
(WebCore::isValidNameASCII): Deleted.
(WebCore::isValidNameASCIIWithoutColon): Deleted.
(WebCore::Document::isValidName): Deleted.
(WebCore::Document::parseQualifiedName): Deleted.
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::toggleAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::setAttributeNS):
(WebCore::Element::parseAttributeName):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/NameValidation.cpp: Added.
(WebCore::NameValidation::isInvalidAttributeNameCharacter):
(WebCore::NameValidation::isInvalidElementNameCharacterAfterAlphaStart):
(WebCore::NameValidation::isValidElementNameContinuationCharacter):
(WebCore::NameValidation::isInvalidNamespacePrefixCharacter):
(WebCore::NameValidation::isInvalidDoctypeNameCharacter):
(WebCore::NameValidation::isValidElementName):
(WebCore::NameValidation::isValidAttributeName):
(WebCore::NameValidation::isValidNamespacePrefix):
(WebCore::NameValidation::isValidDoctypeName):
(WebCore::NameValidation::isValidASCIIXMLName):
(WebCore::NameValidation::isValidXMLNameStart):
(WebCore::NameValidation::isValidXMLNamePart):
(WebCore::NameValidation::isValidXMLName):
(WebCore::NameValidation::parseQualifiedNameToPair):
(WebCore::NameValidation::parseQualifiedElementName):
(WebCore::NameValidation::parseQualifiedAttributeName):
(WebCore::NameValidation::hasValidNamespaceForElements):
(WebCore::NameValidation::hasValidNamespaceForAttributes):
* Source/WebCore/dom/NameValidation.h: Added.
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::checkSetPrefix):
* Source/WebCore/dom/ProcessingInstruction.cpp:
* Source/WebCore/editing/EditorCommand.cpp:
(WebCore::executeFormatBlock):
* Source/WebCore/svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName const):
* Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::handleNamespaceAttributes):
(WebCore::handleElementAttributes):
sideshowbarker added a commit to sideshowbarker/WebKit that referenced this pull request Mar 8, 2026
https://bugs.webkit.org/show_bug.cgi?id=241419

Reviewed by NOBODY (OOPS!).

Implement relaxed name-validation rules per whatwg/dom#1079, whatwg/html#7991,
and whatwg/html#11453. This aligns DOM API name behavior with HTML parser behavior —
which has always allowed a wider range of characters in element and attribute names.

New validation functions in NameValidation.h/cpp:

- isValidElementName(): For createElement — allows [A-Za-z] start followed by
  any char except null/whitespace/>//, or [:_>=0x80] start with restricted continuation
- isValidAttributeName(): For setAttribute/toggleAttribute/createAttribute —
  no null, whitespace, /, >, or =
- isValidNamespacePrefix(): For *NS methods — no null, whitespace, /, or >
- isValidDoctypeName(): For createDocumentType — no null, whitespace, or >
- isValidXMLName(): Preserves old XML Name production for createProcessingInstruction

* LayoutTests/fast/dom/dataset-expected.txt:
* LayoutTests/fast/dom/dataset-xhtml-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument.html:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocumentType-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createAttribute-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS.html:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS.js:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/name-validation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/global-attributes/dataset-set-expected.txt:
* LayoutTests/platform/glib/http/tests/misc/acid3-expected.txt:
* LayoutTests/platform/mac/http/tests/misc/acid3-expected.txt:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType):
* Source/WebCore/dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
(WebCore::Document::createElementForBindings):
(WebCore::Document::createProcessingInstruction):
(WebCore::Document::createElementNS):
(WebCore::Document::createAttribute):
(WebCore::Document::createAttributeNS):
(WebCore::isValidNameStart): Deleted.
(WebCore::isValidNamePart): Deleted.
(WebCore::isValidHTMLElementName):
(WebCore::Document::hasValidNamespaceForElements): Deleted.
(WebCore::Document::hasValidNamespaceForAttributes): Deleted.
(WebCore::isValidNameNonASCII): Deleted.
(WebCore::isValidNameASCII): Deleted.
(WebCore::isValidNameASCIIWithoutColon): Deleted.
(WebCore::Document::isValidName): Deleted.
(WebCore::Document::parseQualifiedName): Deleted.
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::toggleAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::setAttributeNS):
(WebCore::Element::parseAttributeName):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/NameValidation.cpp: Added.
(WebCore::NameValidation::isInvalidAttributeNameCharacter):
(WebCore::NameValidation::isInvalidElementNameCharacterAfterAlphaStart):
(WebCore::NameValidation::isValidElementNameContinuationCharacter):
(WebCore::NameValidation::isInvalidNamespacePrefixCharacter):
(WebCore::NameValidation::isInvalidDoctypeNameCharacter):
(WebCore::NameValidation::isValidElementName):
(WebCore::NameValidation::isValidAttributeName):
(WebCore::NameValidation::isValidNamespacePrefix):
(WebCore::NameValidation::isValidDoctypeName):
(WebCore::NameValidation::isValidASCIIXMLName):
(WebCore::NameValidation::isValidXMLNameStart):
(WebCore::NameValidation::isValidXMLNamePart):
(WebCore::NameValidation::isValidXMLName):
(WebCore::NameValidation::parseQualifiedNameToPair):
(WebCore::NameValidation::parseQualifiedElementName):
(WebCore::NameValidation::parseQualifiedAttributeName):
(WebCore::NameValidation::hasValidNamespaceForElements):
(WebCore::NameValidation::hasValidNamespaceForAttributes):
* Source/WebCore/dom/NameValidation.h: Added.
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::checkSetPrefix):
* Source/WebCore/dom/ProcessingInstruction.cpp:
* Source/WebCore/editing/EditorCommand.cpp:
(WebCore::executeFormatBlock):
* Source/WebCore/svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName const):
* Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::handleNamespaceAttributes):
(WebCore::handleElementAttributes):
webkit-commit-queue pushed a commit to sideshowbarker/WebKit that referenced this pull request Mar 8, 2026
https://bugs.webkit.org/show_bug.cgi?id=241419

Reviewed by Darin Adler.

Implement relaxed name-validation rules per whatwg/dom#1079, whatwg/html#7991,
and whatwg/html#11453. This aligns DOM API name behavior with HTML parser behavior —
which has always allowed a wider range of characters in element and attribute names.

New validation functions in NameValidation.h/cpp:

- isValidElementName(): For createElement — allows [A-Za-z] start followed by
  any char except null/whitespace/>//, or [:_>=0x80] start with restricted continuation
- isValidAttributeName(): For setAttribute/toggleAttribute/createAttribute —
  no null, whitespace, /, >, or =
- isValidNamespacePrefix(): For *NS methods — no null, whitespace, /, or >
- isValidDoctypeName(): For createDocumentType — no null, whitespace, or >
- isValidXMLName(): Preserves old XML Name production for createProcessingInstruction

* LayoutTests/fast/dom/dataset-expected.txt:
* LayoutTests/fast/dom/dataset-xhtml-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument.html:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocumentType-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createAttribute-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS.html:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS.js:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/attributes-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/dom/nodes/name-validation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/global-attributes/dataset-set-expected.txt:
* LayoutTests/platform/glib/http/tests/misc/acid3-expected.txt:
* LayoutTests/platform/mac/http/tests/misc/acid3-expected.txt:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType):
* Source/WebCore/dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
(WebCore::Document::createElementForBindings):
(WebCore::Document::createProcessingInstruction):
(WebCore::Document::createElementNS):
(WebCore::Document::createAttribute):
(WebCore::Document::createAttributeNS):
(WebCore::isValidNameStart): Deleted.
(WebCore::isValidNamePart): Deleted.
(WebCore::isValidHTMLElementName):
(WebCore::Document::hasValidNamespaceForElements): Deleted.
(WebCore::Document::hasValidNamespaceForAttributes): Deleted.
(WebCore::isValidNameNonASCII): Deleted.
(WebCore::isValidNameASCII): Deleted.
(WebCore::isValidNameASCIIWithoutColon): Deleted.
(WebCore::Document::isValidName): Deleted.
(WebCore::Document::parseQualifiedName): Deleted.
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::toggleAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::setAttributeNS):
(WebCore::Element::parseAttributeName):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/NameValidation.cpp: Added.
(WebCore::NameValidation::isInvalidAttributeNameCharacter):
(WebCore::NameValidation::isInvalidElementNameCharacterAfterAlphaStart):
(WebCore::NameValidation::isValidElementNameContinuationCharacter):
(WebCore::NameValidation::isInvalidNamespacePrefixCharacter):
(WebCore::NameValidation::isInvalidDoctypeNameCharacter):
(WebCore::NameValidation::isValidElementName):
(WebCore::NameValidation::isValidAttributeName):
(WebCore::NameValidation::isValidNamespacePrefix):
(WebCore::NameValidation::isValidDoctypeName):
(WebCore::NameValidation::isValidASCIIXMLName):
(WebCore::NameValidation::isValidXMLNameStart):
(WebCore::NameValidation::isValidXMLNamePart):
(WebCore::NameValidation::isValidXMLName):
(WebCore::NameValidation::parseQualifiedNameToPair):
(WebCore::NameValidation::parseQualifiedElementName):
(WebCore::NameValidation::parseQualifiedAttributeName):
(WebCore::NameValidation::hasValidNamespaceForElements):
(WebCore::NameValidation::hasValidNamespaceForAttributes):
* Source/WebCore/dom/NameValidation.h: Added.
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::checkSetPrefix):
* Source/WebCore/dom/ProcessingInstruction.cpp:
* Source/WebCore/editing/EditorCommand.cpp:
(WebCore::executeFormatBlock):
* Source/WebCore/svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName const):
* Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::handleNamespaceAttributes):
(WebCore::handleElementAttributes):

Canonical link: https://commits.webkit.org/308884@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

7 participants