* Ignore rendering-transparent nodes between discussion comments.
* Improve isRenderingTransparentNode() so that <link> nodes
representing TemplateStyles are not considered transparent,
otherwise this would undo ae920b831f.
Using a regexp from Parsoid.
Bug: T272746
Change-Id: I0b3c3251156ba6c4826abf5ba44ea93f80ebc01d
Several of the messages talk about clicking the reply links, which
seems unhelpful. Also, showing a fullscreen popup on page load seems
very unhelpful too. (Itoldyouso that we shouldn't use popups.)
Bug: T268069
Change-Id: Id1312cf06200fb45a28b39481a99cc2c96603fa4
If the user is clicking on a new topic link, and a reply widget is
open, attempt to close it instead of doing nothing.
Bug: T272545
Change-Id: I1903f5ae4c9e98c4b3a4703ad0e44d772894592a
We'd like the [reply] links to behave differently if other
CommentControllers are already active, but each CommentController
doesn't know anything about others; only the main controller.js does.
Change-Id: Ic21b2d40d213a325509822f703709f52aa8dc8d7
If the module is loaded on a page where DiscussionTools is
not supposed to be enabled, wgDiscussionToolsFeaturesEnabled
will be undefined, and the code will crash before it can set
the cookie that enables it for future page views.
Bug: T272850
Change-Id: Ia1c40cfc3cbee62823f1806bd20229883905677a
Add yet another tree walking utility: CommentUtils::linearWalk().
Unlike TreeWalker, it allows handling the beginnings and ends of nodes
separately – kind of like parsing a XML token stream, or kind of like
VisualEditor's linear model.
(Add unit tests for this utility. The simple.html test case is copied
from [VisualEditor/VisualEditor]/demos/ve/pages/simple.html.)
Use this utility to stop skipping when we reach either a closing or
opening block node tag. Previously we'd skip over such tags inside
nested "transparent" nodes (like <a>, <del>, or apparently <font>).
Bug: T271385
Change-Id: I201a942eb3a56335e84d94e150ec2c33f8b4f4e0
Remove unused error codes, update the ones that changed, and sort in
the order in which the types are listed on the schema page.
Bug: T272162
Change-Id: Ib16f7e11ff81d43443b08cf704ce5196420671e4
Don't assume a feature is available because the code has
loaded and the user option is set. Export the logic from
Hooks.php to the client.
Change-Id: Ica0e58de7ed0d59e3b09645193eb2b691ae41c39
If DiscussionToolsABTest is enabled (set to `all` or a feature), logged
in users who have never used the tool before will be assigned to an a/b
test bucket. If they're in the test bucket, they get the feature
enabled.
If they manually set their beta feature preference, we don't override
that but do maintain their bucket for logging purposes.
Bug: T268191
Change-Id: I9c4d60e9f9aaef11afa7f8661b9c49130dde3ffa
1. Extend the JS modifier to allow adding top-level comments
(that is, replies to headings). PHP modifier doesn't do this
because we'll save the changes using paction=addtopic instead.
2. Subclass CommentController to allow adding a new heading and a
top-level comment underneath it at the same time.
3. A lot of ugly code in ReplyWidget to customize the interface
for this case. Much of it should probably be moved to
CommentController/NewTopicController.
Bug: T267595
Change-Id: I9c707bb7f7aae1b92c72fb4dee436490f8c8409b
As a result of 0fc71f60cd, "empty" text
nodes (containing only whitespace) at the end of the comment may be
inside the comment's range, and trying to ignore them caused the
ranges not to match and the frame not to be detected.
Now the code works whether they're inside the comment's range or not.
Add a test case for wrapped discussion comments with HTML comments and
with whitespace.
Bug: T250126
Bug: T268407
Change-Id: I2217ff5a635fd1c9c9e803f46795b1bfb3d17535
Follow-up to d5a1b7bc2b.
The rule hiding the scrollbar was applied to the wrong element.
Bug: T267609
Change-Id: I596f29ba191032a82c579c63e9aa526eb4e887aa
The problem was fixed in 15cb419f56,
then the comment restored in 633cc9a7b3
(looks like a rebase mistake).
Change-Id: Ic31ea0bf88480cff02f40701f1317f35c1c6e891
While working on T270009, I noticed that <style> and <link> nodes
are treated differently, which seemed weird. Rewrite this again,
hopefully this is the last time.
The changed test cases also involve <area> and <input> nodes,
and the new results make more sense to me.
Bug: T264116
Change-Id: I3af90c84768a4b3dc53446927f4dba6f72175a2f