Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHave CharacterData call children_changed on its parent when data is set. #17501
Conversation
|
@bors-servo try |
Have CharacterData call children_changed on its parent when data is set. **Can't run WPT on my computer, so pushing here to run tests😢 ** Have CharacterData.SetData call children_changed on its parent when data is set (if it is a Text node) so that HTMLStyleElement parents can re-parse. Add variant ChildrenMutation::Text for it to use as the mutation. This fixes an issue where an empty <style> element's data is set but the style is not updated. An HTMLStyleElement parent re-parses in its children_changed implementation. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes are part of a series to fix #17182 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17501) <!-- Reviewable:end -->
|
|
|
I suspect we always want to call replace_ node_ranges. |
|
Oops, my bad. Shouldn't have pulled that into the branch. |
|
@bors-servo: try |
Have CharacterData call children_changed on its parent when data is set. **Can't run WPT on my computer, so pushing here to run tests😢 ** Have CharacterData.SetData call children_changed on its parent when data is set (if it is a Text node) so that HTMLStyleElement parents can re-parse. Add variant ChildrenMutation::Text for it to use as the mutation. This fixes an issue where an empty <style> element's data is set but the style is not updated. An HTMLStyleElement parent re-parses in its children_changed implementation. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes are part of a series to fix #17182 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17501) <!-- Reviewable:end -->
|
|
|
Test in question,
After this commit, we get a lot of |
|
@bors-servo: try EDIT: Finally it works! No one man should have all that power. |
Have CharacterData call children_changed on its parent when data is set. **Can't run WPT on my computer, so pushing here to run tests😢 ** Have CharacterData.SetData call children_changed on its parent when data is set (if it is a Text node) so that HTMLStyleElement parents can re-parse. Add variant ChildrenMutation::Text for it to use as the mutation. This fixes an issue where an empty <style> element's data is set but the style is not updated. An HTMLStyleElement parent re-parses in its children_changed implementation. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes are part of a series to fix #17182 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17501) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
Have CharacterData call children_changed on its parent when data is set. **Can't run WPT on my computer, so pushing here to run tests😢 ** Have CharacterData.SetData call children_changed on its parent when data is set (if it is a Text node) so that HTMLStyleElement parents can re-parse. Add variant ChildrenMutation::Text for it to use as the mutation. This fixes an issue where an empty <style> element's data is set but the style is not updated. An HTMLStyleElement parent re-parses in its children_changed implementation. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes are part of a series to fix #17182 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17501) <!-- Reviewable:end -->
|
|
|
@Manishearth hi! would you have time to review this? |
|
r=me, with my comments addressed at you wish (none of them are a big deal, just feel free to change it if you agree) |
| /// Mutation for when a Text node's data is modified. | ||
| /// This doesn't change the structure of the list, which is what the other | ||
| /// variants' fields are stored for at the moment, so this can just have no | ||
| /// arguments. |
This comment has been minimized.
This comment has been minimized.
emilio
Jul 12, 2017
Member
nit: this can have no fields instead? Actually, no big deal, it's understandable.
This comment has been minimized.
This comment has been minimized.
emilio
Jul 12, 2017
Member
I'd also probably call this TextContentChanged or something like that, but that maybe associates it too much with the textContent property?
This comment has been minimized.
This comment has been minimized.
jyc
Jul 12, 2017
Author
Contributor
"this can have no fields" is more consistent, thanks for catching that! hm, "Text" looks nicer but the other ones are describing actions and "Text" is just a noun. maybe "ChangeText" (the others are present tense infinitives)? then it fits with us calling content_changed and with this applying for Text nodes, maybe
| pub fn next_child(&self) -> Option<&Node> { | ||
| match *self { | ||
| ChildrenMutation::Append { .. } => None, | ||
| ChildrenMutation::Insert { next, .. } => Some(next), | ||
| ChildrenMutation::Prepend { next, .. } => Some(next), | ||
| ChildrenMutation::Replace { next, .. } => next, | ||
| ChildrenMutation::ReplaceAll { .. } => None, | ||
| ChildrenMutation::Text => None, |
This comment has been minimized.
This comment has been minimized.
emilio
Jul 12, 2017
Member
Hm... Do we restyle properly when the text changed affects how we should match :empty?
This comment has been minimized.
This comment has been minimized.
emilio
Jul 12, 2017
Member
Of course probably before this we don't, so it should not block landing, but afterwards probably we still don't do the right thing... In particular, I'd expect servo to fail http://searchfox.org/mozilla-central/source/layout/reftests/bugs/534804-1.html.
If it does, mind filing an issue for it?
This comment has been minimized.
This comment has been minimized.
jyc
Jul 12, 2017
Author
Contributor
I think I will probably file an issue and try to get back to this later, because I really want to get some work in on the project I've been assigned. Will test this quickly, though.
This comment has been minimized.
This comment has been minimized.
|
@bors-servo: r=emilio |
|
|
Have CharacterData call children_changed on its parent when data is set. **Can't run WPT on my computer, so pushing here to run tests😢 ** Have CharacterData.SetData call children_changed on its parent when data is set (if it is a Text node) so that HTMLStyleElement parents can re-parse. Add variant ChildrenMutation::Text for it to use as the mutation. This fixes an issue where an empty <style> element's data is set but the style is not updated. An HTMLStyleElement parent re-parses in its children_changed implementation. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes are part of a series to fix #17182 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17501) <!-- Reviewable:end -->
|
|
|
Have CharacterData.SetData call children_changed on its parent when data is set (if it is a Text node) so that HTMLStyleElement parents can re-parse. Add variant ChildrenMutation::Text for it to use as the mutation. This fixes an issue where an empty <style> element's data is set but the style is not updated. An HTMLStyleElement parent re-parses in its children_changed implementation.
|
@bors-servo: retry |
|
@bors-servo: r=emilio |
|
|
Have CharacterData call children_changed on its parent when data is set. **Can't run WPT on my computer, so pushing here to run tests😢 ** Have CharacterData.SetData call children_changed on its parent when data is set (if it is a Text node) so that HTMLStyleElement parents can re-parse. Add variant ChildrenMutation::Text for it to use as the mutation. This fixes an issue where an empty <style> element's data is set but the style is not updated. An HTMLStyleElement parent re-parses in its children_changed implementation. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes are part of a series to fix #17182 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17501) <!-- Reviewable:end -->
|
|
Replace Namespace components which map to the default namespace with DefaultNamespace - Fix eliding default namespace when serializing - Fix shortest serialization property when namespace prefix is `*|` and there is no default namespace <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes is part of a series to fix #17182 <!-- Either: --> I'd like to land #17501 first, because it allows some tests for this to work. - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17537) <!-- Reviewable:end -->
Some fixes to selector serialization re: namespaces and universal selector - Fix eliding default namespace when serializing - Fix shortest serialization property when namespace prefix is `*|` and there is no default namespace - Omit universal selector when serializing to match `cssom/serialize-namespaced-type-selectors` (again so we get the shortest serialization) <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes is part of a series to fix #17182 <!-- Either: --> I'd like to land #17501 first, because it allows some tests for this to work. - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17537) <!-- Reviewable:end -->
Some fixes to selector serialization re: namespaces and universal selector - Fix eliding default namespace when serializing - Fix shortest serialization property when namespace prefix is `*|` and there is no default namespace - Omit universal selector when serializing to match `cssom/serialize-namespaced-type-selectors` (again so we get the shortest serialization) <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes is part of a series to fix #17182 <!-- Either: --> I'd like to land #17501 first, because it allows some tests for this to work. - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17537) <!-- Reviewable:end -->
Some fixes to selector serialization re: namespaces and universal selector - Fix eliding default namespace when serializing - Fix shortest serialization property when namespace prefix is `*|` and there is no default namespace - Omit universal selector when serializing to match `cssom/serialize-namespaced-type-selectors` (again so we get the shortest serialization) <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes is part of a series to fix #17182 <!-- Either: --> I'd like to land #17501 first, because it allows some tests for this to work. - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17537) <!-- Reviewable:end -->
Some fixes to selector serialization re: namespaces and universal selector - Fix eliding default namespace when serializing - Fix shortest serialization property when namespace prefix is `*|` and there is no default namespace - Omit universal selector when serializing to match `cssom/serialize-namespaced-type-selectors` (again so we get the shortest serialization) <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes is part of a series to fix #17182 <!-- Either: --> I'd like to land #17501 first, because it allows some tests for this to work. - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17537) <!-- Reviewable:end -->
Some fixes to selector serialization re: namespaces and universal selector - Fix eliding default namespace when serializing - Fix shortest serialization property when namespace prefix is `*|` and there is no default namespace - Omit universal selector when serializing to match `cssom/serialize-namespaced-type-selectors` (again so we get the shortest serialization) <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes is part of a series to fix #17182 <!-- Either: --> I'd like to land #17501 first, because it allows some tests for this to work. - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17537) <!-- Reviewable:end -->
jyc commentedJun 23, 2017
•
edited by larsbergstrom
Can't run WPT on my computer, so pushing here to run tests😢
Have CharacterData.SetData call children_changed on its parent when
data is set (if it is a Text node) so that HTMLStyleElement parents can
re-parse. Add variant ChildrenMutation::Text for it to use as the
mutation.
This fixes an issue where an empty <style> element's data is set but the
style is not updated. An HTMLStyleElement parent re-parses in its
children_changed implementation.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is