-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[RFC] Add a way to opt-in ext/dom spec compliance #13031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 207 commits
Commits
Show all changes
218 commits
Select commit
Hold shift + click to select a range
df3e034
Add and adapt helper functions for checking spec compliant mode
nielsdos d5a65d3
Implement spec-compliant reconciliation
nielsdos a0dcae0
Add todo
nielsdos 8ea661c
Fix attribute entity subsitution
nielsdos 9c96791
Fix edge case of splitText() not throwing an exception
nielsdos c3afad0
Move to DOMDocument only
nielsdos 370e18a
Implement spec checks for createCDATASection
nielsdos 23c253c
Implement spec checks for createProcessingInstruction
nielsdos 5b06d5b
Add additional import test
nielsdos abce5af
Use common API for creating a fully qualified name
nielsdos 0b2213b
Implement spec-compliant behaviour for DOMElement::$tagName
nielsdos f834bc5
Start of new namespace compatibility implementation
nielsdos 9fd9347
Use new common namespace API
nielsdos 1cf3493
Make getAttributeNames() ignore internal namespace declarations in sp…
nielsdos 57c7079
Use namespace concatenation helper
nielsdos 6926035
Add todo
nielsdos db957ac
Implement spec-compliant behaviour for DOMNode::$nodeName
nielsdos 1ed8159
Enable test that previously didn't work because of ext/dom spec bugs
nielsdos 42d0c66
Make createAttributeNs spec compliant
nielsdos 851ba8c
Fix spec-compliance of setAttributeNode(NS)
nielsdos a37c5f2
Remove unused code
nielsdos 5f5b5e6
Make isEqualNode spec compliant after attribute handling change
nielsdos cb46b54
Fix serialization bug
nielsdos bbd013b
Add test for legacy entity expansion behaviour
nielsdos ac9461d
Make createElement spec compliant
nielsdos e9dddf1
Generalise fast namespace checking
nielsdos 719dc2f
Make createAttribute() spec compliant
nielsdos ddab138
Make createElementNS spec compliant
nielsdos 07fd6c1
Fix crashes
nielsdos 8f7f0df
Fix another crash
nielsdos d212cec
Remove obsolete todo
nielsdos 4e2a3b9
Namespace fixes
nielsdos a7af06a
Make getElementsByTagName spec compliant
nielsdos 76c9777
Mark date in comment
nielsdos 1b5c5e0
Make Document::$documentURI spec compliant
nielsdos 0ac12c9
Define namespaces as close to the element as possible
nielsdos 6254d73
Make prefix unmodifiable
nielsdos 89f6e43
Fix test case output
nielsdos 7af8075
Move tests
nielsdos f83376d
Fix spec compliance of pre-insertion validation
nielsdos aa6fee5
Remove TODO
nielsdos 8e7978d
Fix adjacent text merging bug
nielsdos ac21691
Add test for getElementsByTagNameNS
nielsdos 22edb0f
Tests for isEqualNode
nielsdos 956de2c
Fix new issues
nielsdos f9016e0
Spec compliance part 2 for setAttributeNode
nielsdos 2e99976
Make importNode throw when needed
nielsdos b3fde71
Make dtd importable and cloneable
nielsdos 6250966
Make appendChild work with dtd
nielsdos e656a97
Fix attaching of attributes
nielsdos d660ed6
Correct condition
nielsdos dfc05d2
Lots of attribute handling fixes
nielsdos 77521b8
Make getAttributeNodeNS() spec compliant
nielsdos 904c4a5
Add test for getAttribute()
nielsdos 852ee45
Make getAttributeNS() spec compliant
nielsdos f06c0e1
Avoid copying
nielsdos 1bcbdcd
Fix stream path detection
nielsdos 9bf0349
[ci skip] Add comment
nielsdos 4a2df19
Avoid allocations
nielsdos 074a1aa
Use request allocator if possible
nielsdos 9254944
Test hasAttribute
nielsdos af194b3
Make hasAttributeNS spec compliant
nielsdos 2d80cf0
Make removeAttribute() spec compliant
nielsdos fd59178
Cleanup
nielsdos 2acaa10
Make removeAttributeNS() spec compliant
nielsdos 64d2a39
Make setAttribute() spec compliant
nielsdos b31cfb4
Move setAttributeNS legacy implementation
nielsdos ff16b16
Make setAttributeNS() spec compliant
nielsdos e7dac91
Fixup testcase
nielsdos e42e2be
Specified is always true in modern-day dom
nielsdos c7bbcd5
Remove TODO, this is unfixable
nielsdos 8cccffe
Not anymore
nielsdos 5ca64e7
Cleanup
nielsdos 449ce4a
Fix spec compliance of isDefaultNamespace
nielsdos 628d0df
Faster textContent write
nielsdos a2392b6
Fix mistake in setAttributeNS
nielsdos 3240bbd
Make lookupNamespaceURI() spec compliant
nielsdos 0fc0519
Make lookupPrefix() spec compliant
nielsdos 9c1181d
Fix name matching of getElementsByTagNameNS
nielsdos fa69cf1
Cleanup
nielsdos 6015440
Fix setAttribute qualified name matching
nielsdos 0261e8e
Demote DOMNameSpaceNode
nielsdos 96b9da2
More namespace tests
nielsdos 0f2f355
Make replaceChild() spec compliant
nielsdos c2bb363
Fix crash
nielsdos 5b83301
Make toggleAttribute spec compliant
nielsdos d354127
Optimize oldNS use
nielsdos a8f5aae
Remove useless NULL check
nielsdos 459e39f
Remove now-incorrect comment
nielsdos 5c7e706
Split out pre-insertion validity check into separate method
nielsdos 5670a22
Refactor parentnode.c and bring it closer to spec
nielsdos 5845c79
Move function
nielsdos f3bc819
Rewrite large parts of parentnode.c to comply with spec
nielsdos 93aad39
Fix static analysis complaints
nielsdos bcd7107
Make appendChild() spec compliant
nielsdos 6acafc3
Fix spec compliance of insertAdjacent methods
nielsdos 6cb15af
Make nodeValue null for elements
nielsdos 42bd557
Fix issue with document properties and cloneNode
nielsdos 0900497
Make DOMAttr::$name spec compliant
nielsdos 499e006
Fixup attribute tests
nielsdos b314b95
Split off insertBefore
nielsdos 8fa009f
Split off check
nielsdos 2778697
Add missing invalidation
nielsdos 35fbc4d
Do step 3 of pre-insert validity anyway for simplicity sake
nielsdos 0f7aab9
Smarter freeing strategy
nielsdos 47ed99a
Implement insertBefore according to spec
nielsdos 12e47fc
Fixes to hierarchy checks
nielsdos 4480793
Avoid memory allocation
nielsdos 0dd7c26
Fix nodes becoming inaccessible after normalizing
nielsdos a449bc7
Avoid allocation
nielsdos 15ee3e7
Make normalize spec compliant
nielsdos 5de39f1
Fix prefix of xmlns after parsing
nielsdos ae977b7
Fix xlink attribute namespace
nielsdos 6dffddf
Add test for namespaced attributes
nielsdos 5b0c7ff
Normalization tests update
nielsdos f3d83c9
Make textContent spec compliant
nielsdos d359f07
Fix negative bounds in insertData
nielsdos c901097
Negative length in insertData
nielsdos 1d3afce
Fix replaceData negative count
nielsdos 6236996
substringData negative arguments
nielsdos 1894f69
Fix reconciliation of attributes
nielsdos 6c46137
Fix indent
nielsdos 7501361
Move common tree walk code into php_dom_next_in_tree_order()
nielsdos 1d28b16
Namespace reconciliation logic for elements
nielsdos bcbc4bf
Fix cloning a dtd node
nielsdos 72edcf0
More testing
nielsdos 5d47aba
Avoid duplicate work
nielsdos 2073dd3
Split off function
nielsdos bb45275
Remove type check for now-unused libxml type
nielsdos 6eb1895
Make DOMNamedNodeMap spec compliant
nielsdos e1df8dd
Directly call the right function instead of through the helper
nielsdos 585d034
Smarter mangling
nielsdos f7b5c9f
Don't add too many UNEXPECTEDs to avoid moving too much code to cold …
nielsdos 6093fa2
Make traversal method always inlined
nielsdos 5b9beda
Improve performance of reconciliation
nielsdos 45b72c2
More test coverage for normalization
nielsdos 224bd78
Remove dead code
nielsdos f8480a5
More testing and get rid of special case
nielsdos c55c04c
More test coverage
nielsdos ecd9871
More tests for isDefaultNamespace
nielsdos c160db1
Better testing of setAttributeNode
nielsdos 3a7427b
Comment with more explanation
nielsdos 1faf7fd
Minor performance improvements
nielsdos b71e320
Import and clone spec compliance fixes
nielsdos c3ed9f7
Comments
nielsdos c19a95d
Mark namespace attributes at the front of the attribute list
nielsdos d70a990
Implement XML serialization
nielsdos f408c74
Propagate save error
nielsdos b837d73
Handle errors and encoding
nielsdos f27f8d2
Fixes
nielsdos 5c21dee
Create namespace of attribtue as close to attribute's element as poss…
nielsdos 61e0513
Add todo
nielsdos 9dd7bdf
Remove redundant include
nielsdos 3589f27
Improve dom_ns_fast_get_html_ns() logic
nielsdos 9c34092
Test case where the XML is already formatted
nielsdos b138ffd
Test additional namespace bugs
nielsdos 4d87be2
Fix closing the encoding handler
nielsdos c61cae7
New namespace compatibility implementation
nielsdos 3fca2c8
Initial pass at splitting classes
nielsdos 8da79f9
More test coverage for new types
nielsdos f6a0863
Don't declare the soon-to-be-deprecated namespace variant of PHP_ERR
nielsdos 932b83c
Fix import implementation class type check, and test
nielsdos d43a491
Version is not nullable
nielsdos 927f75a
Refactor dom_node_children_valid because it's usage is confusing
nielsdos acbae0a
Already did this
nielsdos fd9535e
Implement importLegacyNode
nielsdos 3c927cb
Fix inconsistent handling of ns_mapper vs spec-compliance in cloning
nielsdos f78b2d7
xmlEncoding is not nullable
nielsdos 3b8133e
Implement DTDNamedNodeMap
nielsdos 5d55d84
Initial fixes for XPath
nielsdos 6ef7fc6
Fix namespace node problem
nielsdos c1f5429
Split off namespace allocation code
nielsdos 99a3cbb
Cleanup
nielsdos 1ee0ef2
Print out namespace in noscript test
nielsdos da4623d
Update exception message
nielsdos 36f95d9
Use fast ns checker more where possible
nielsdos 9a04e79
Fix XPath and context node namespace registration
nielsdos 4e55897
Fix type of baseURI
nielsdos db8d587
Corrections
nielsdos 97edc64
Improve coverage of code using string macros
nielsdos 9d87131
More test coverage for CharacterData edge cases
nielsdos b54ce01
Test createElement edge cases
nielsdos bf96916
Remove deprecated error type
nielsdos 5f4ca9c
Test edge case of removeAttribute
nielsdos 303ca80
Fix indent
nielsdos 2758dc4
Remove dead code
nielsdos be07c52
Remove always-true check
nielsdos 216a9fc
Test more edge cases for insertData
nielsdos 4fd601b
Use class name from ce
nielsdos 5566780
Serialize entity references too for compatibility
nielsdos 19c913c
Make quote method available on new XPath class too
nielsdos 7c22119
Make error message more accurate for old DOM
nielsdos 81986a3
Rename tests for consistency
nielsdos 90ff928
Fix unused variable warnings
nielsdos e4aebfb
Fix ext/xsl interaction with new DOM
nielsdos 577169b
Make namespace APIs public
nielsdos f5a5ddc
Fix XSLTProcessor lifetime issue wrt namespaces
nielsdos 2df9e30
Make dimension handlers in new DOM more strict
nielsdos 725db63
Mark other object handlers static as well
nielsdos 87bbca6
Remove useless free call
nielsdos 436dd58
Cleanup
nielsdos 1f245c7
Port over DOMImplementation
nielsdos a069341
Fix prefix of DOM\Attr
nielsdos 3d62a3a
Fix unlikely memleak
nielsdos f0af56f
TEMPORARILY collapse test files so that GH UI doesn't break
nielsdos b2a7b78
Review comments part 1
nielsdos 27efef4
Review fixes
nielsdos 422595c
Initialize should_free_result to false instead everywhere
nielsdos 42168a2
Implement numeric string handling for new DOM named dimension
nielsdos 4afad64
Also numeric string handling for NodeList
nielsdos da46be3
Get rid of tentative returns
nielsdos 934f797
Revert "TEMPORARILY collapse test files so that GH UI doesn't break"
nielsdos d5e6934
Extend test for bug47847
nielsdos 7956d50
NEWS UPGRADING etc
nielsdos e0b520e
Fix test formatting
nielsdos 922a7d8
Test extension
nielsdos 7a847b1
Test improvements
nielsdos 3812d1b
Cleanup test
nielsdos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,5 @@ | |
|
||
# Vendored libraries | ||
/ext/dom/lexbor/lexbor linguist-vendored | ||
|
||
*.phpt linguist-generated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.