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 upLinks don't work if the text has formatting inside an <a> tag #4236
Comments
|
This is a good testcase for the design of #4002; thanks! |
|
#4002 seems merged, can this be closed? |
|
Have we tested whether this case works now? |
|
The bold part of the last link still doesn't work. |
|
Do we bubble up click events at all? |
|
Paging @Manishearth. The concept of "nearest activatable element" that he implemented should be relevant here. |
|
Oh, it looks like we haven't hooked up link clicking to the new activation code; it still uses actual click events. We should correct that. |
|
Yeah, it's on my todo (or, hopefully-get-Ms2ger-todo) list. Ms2ger had a partial implementation but it won't fit cleanly with If someone else wants to pick it up, feel free -- I can mentor |
|
Spec link: https://html.spec.whatwg.org/multipage/semantics.html#the-a-element:activation-behavior You can see an example usage of
You'll also need to add to the vtable in ActivationElementHelpers::as_maybe_activatable |
|
@shinglyu This would be a valuable issue to work on if you're interested :) |
|
Ah thanks @jdm , I'll work on it. |
|
Hi @Manishearth , I read the spec and tried to find the relevant code. I wonder where is the code that handles Also, can you explain what "You'll also need to add to the vtable in ActivationElementHelpers::as_maybe_activatable" means? Do you mean I need to add Thank you. |
|
http://mxr.mozilla.org/servo/source/components/script/dom/htmlanchorelement.rs#59 is the current implementation. And the answer to the second question is that you need to add |
|
Currently |
|
Is there any relevant automation test for this? Or do I have to manually click through the links to test it? Thanks. |
|
I think if you make a test like http://mxr.mozilla.org/servo/source/tests/content/test_click_prevent.html?force=1 and test that the |
|
Activation is a bit harder to test for nested elements since |
|
Just moved the |
|
Ah, nice. Make sure you include the |
|
Hmm.. I added something like this: https://github.com/shinglyu/servo/compare/bug4236#diff-9082d52f79e121265b7ddf64d11fe044R1468 |
|
Oh, that's because you've not casted everything properly. You should be casting within the match itself for each arm, and the match should produce an |
|
Yes, each arm of the match needs to produce an identical type. Right now that's not happening. |
|
The previous problem is solved, I manually tested it and the But I have some problem understanding step 1, 2 and 3 in anchor element's activation behaviour, can I create a pull request for my current progress, and deal with these steps in a follow-up bug? Step 1: Don't really know how to check if the node document is fully active, I guess it's like button element's Step 2: There are too many technical terms I don't understand yet, I may need some time to understand them and figure out how to turn them into Rust code. Step 3: Seems irrelevant to the test cases in the first comment. It seems like a separate feature and I can implement it in a follow up issue. |
|
TL;DR: Skip all three if you want; leave comments/file followup issues. The third one is something you might want to try (whether in the same PR or another). Just some explanation of the specs/code to get you more familiar: Step 1
I don't think we have a way of checking document activity yet; at least my implementation for Step 2 Okay, this one's a doozy. However, we don't support tabs and all yet, and frame support is pretty flaky, so working this out IMO isn't too important. Again, I suggest you skip this and leave a comment (file a followup maybe?). I'll still explain it in part so that you'll be able to understand such things in the future :) It's basically talking about handling the Step 3 This one can actually be implemented, though I personally don't mind if you skip it for now. This has to do with image maps -- these are images where clicking in different places is supposed to have different behavior. Just in case you need help with it, here is the same algorithm deconstructed with links to relevant code you might want to use. Try not to use this, but it will be useful in case you get stuck
To implement this you'll need to add two new arguments to
|
|
I'd leave all three alone for the purpose of fixing this issue; however, please do leave comments along the lines of "// Step 1: document not fully active". Bonus points for filing issues about those steps. |
|
Thanks @Manishearth for the great tutorial! |
In this test case, the first two links work, and the last link works, but the third one with the
<b>tag inside the tag doesn't work.