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 upIssue 7720: Add target selector and update when scrolling to fragment #11726
Conversation
highfive
commented
Jun 11, 2016
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @metajack (or someone else) soon. |
highfive
commented
Jun 11, 2016
highfive
commented
Jun 11, 2016
|
I can review this but I'll be travelling for the next couple of days so I may not be online much. If another reviewer can get to it sooner, feel free to steal it.
Yes, calling window.reflow is correct. You can look at (Side note: While glancing at this code I noticed that |
|
Thanks Matt, I'll add the reflow call and more than happy to investigate active_state! |
|
Ok added the reflow (I chose ReflowReason::DocumentLoaded) then did some more flailing; I think that (a) the script_thread.handle_navigate function is dealing with Step 7 of https://html.spec.whatwg.org/multipage/browsers.html#navigating-across-documents and is functional, but that (b) loading a new document with an URL fragment is Step 6 of https://html.spec.whatwg.org/multipage/browsers.html#update-the-session-history-with-the-new-page and is currently non-functional. There is a sporadic scroll; but this occurs due to handle_resize_event so i'm not sure it's intentional and didn't look like the right place to add code setting the pseudo-selector. For this reason; i've added a second commit to the PR that scrolls to the fragment and adds the pseudoselector after the document loads. I'm not convinced it's in the right place, and the test no longer fails; but instead times out... so i'm not sure that's much progress. I think I still need to add a test for scenario a) - if so, do I just commit one to the web-platform-tests? |
d3898c3
to
7ba80c8
highfive
commented
Jun 14, 2016
|
New code was committed to pull request. |
|
active state is not yet implemented; it's referenced in an existing issue, #8719 |
|
This looks good! Some minor comments below.
I think that scrolling on load is correct. It looks like this test is just so big that it always times out in debug builds (even without these changes). In a release build it passes. -S-awaiting-review +S-needs-code-changes Reviewed 7 of 7 files at r1, 3 of 3 files at r2, 3 of 3 files at r3. components/script/dom/document.rs, line 1844 [r1] (raw file):
Suggestion: This function could be simplified slightly by using components/script/dom/document.rs, line 1859 [r2] (raw file):
I think we should add a new ReflowReason, something like ElementStateChanged. Comments from Reviewable |
7ba80c8
to
697b9a2
|
Looks ready to merge? |
|
I'd like to take a look; hopefully today, but might be tomorrow. |
|
|
697b9a2
to
cd4f734
|
I've rebased this - maybe the label will get removed next time Homu visits? |
|
ping @Ms2ger? You wanted to review this :) |
9596c97
to
04f5369
|
...sorry about that. have removed the entries from ParentNode-querySelector-all-xht.xht |
|
@bors-servo: r=mbrubeck |
|
|
Issue 7720: Add target selector and update when scrolling to fragment <!-- Please describe your changes on the following line: --> Add the target pseudo selector and set/unset it during scrolling to fragment. This change is not complete as no repaint is triggered after the selector is added - it will only take effect after a repaint is triggered by e.g. hovering over another element. (See manual test) I would like some help because i'm not sure how to resolve this; I can only think to call window.reflow. I added a manual test case, don't think this counts really! I think the applicable automated test is in /tests/wpt/web-platform-tests/dom/nodes/Element-matches.html but it currently fails, I think due to the above. --- <!-- 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 fix #7720 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11726) <!-- Reviewable:end -->
|
|
highfive
commented
Aug 3, 2016
|
|
@bors-servo: retry |
Issue 7720: Add target selector and update when scrolling to fragment <!-- Please describe your changes on the following line: --> Add the target pseudo selector and set/unset it during scrolling to fragment. This change is not complete as no repaint is triggered after the selector is added - it will only take effect after a repaint is triggered by e.g. hovering over another element. (See manual test) I would like some help because i'm not sure how to resolve this; I can only think to call window.reflow. I added a manual test case, don't think this counts really! I think the applicable automated test is in /tests/wpt/web-platform-tests/dom/nodes/Element-matches.html but it currently fails, I think due to the above. --- <!-- 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 fix #7720 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11726) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
Issue 7720: Add target selector and update when scrolling to fragment <!-- Please describe your changes on the following line: --> Add the target pseudo selector and set/unset it during scrolling to fragment. This change is not complete as no repaint is triggered after the selector is added - it will only take effect after a repaint is triggered by e.g. hovering over another element. (See manual test) I would like some help because i'm not sure how to resolve this; I can only think to call window.reflow. I added a manual test case, don't think this counts really! I think the applicable automated test is in /tests/wpt/web-platform-tests/dom/nodes/Element-matches.html but it currently fails, I think due to the above. --- <!-- 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 fix #7720 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11726) <!-- Reviewable:end -->
|
|
sjmelia commentedJun 11, 2016
•
edited
Add the target pseudo selector and set/unset it during scrolling to fragment. This change is not complete as no repaint is triggered after the selector is added - it will only take effect after a repaint is triggered by e.g. hovering over another element. (See manual test)
I would like some help because i'm not sure how to resolve this; I can only think to call window.reflow.
I added a manual test case, don't think this counts really! I think the applicable automated test is in /tests/wpt/web-platform-tests/dom/nodes/Element-matches.html but it currently fails, I think due to the above.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is