* Use the event's timeStamp rather than the current time in the event
subscriber.
* Instead of using ve.trackSubscribeAll() and then branching on the topic
prefix, just use ve.trackSubscribe( prefix, ... ) to bind prefix-specific
handlers.
* Round timing measurements after performing arithmetic, and use Math#round
rather than Math#floor.
* Rename 'getDefaultTiming' to 'computeDuration'.
Change-Id: I27ff1622ecea9b82d414f871441f127fc2dbd2cc
New changes:
0ceafd5 Fix V8 deopt for ve.ce.BranchNode#onSplice
01d2d4b [BREAKING CHANGE] Store originalDomElements instead of htmlAttributes
96005a7 Localisation updates from https://translatewiki.net.
42e672e ve.ui.Toolbar: Don't call #updateToolState from #initialize
373562d Localisation updates from https://translatewiki.net.
Local changes:
Update for htmlAttributes going away
Change-Id: I576a1e5d5883b03d1fff6666926f80a5682a280f
Otherwise it gets built lazily when building the view tree,
and that makes it difficult to instrument it separately.
Change-Id: Ie8c2027e87a87e59323165f0edbba49c4a66d1b3
Tracked stages are:
* activate: wraps the entire activation
* domLoad: API request for Parsoid HTML
* parseResponse: parse HTML, interpret things like link cache data
* convertModelFromDom: create linear model from Parsoid DOM
* createSurface: build DM and CE trees, create DM, CE and UI surfaces
* initializeSurface: initialize UI and CE surfaces, and CE nodes
* setupToolbar: toolbar setup and attachment
* initializeToolbar: toolbar initialization (deferred so not wrapped by activate)
Bug: T89536
Change-Id: Ife5664e872bad68dcf3c123f274f9c8a38a06031
It's slow, especially on large pages, and it's triggered
very infrequently these days, and only for known bugs.
In the future we should replace this with a debugging
interface that displays the DOM diff between the original
DOM and the round-tripped DOM, as opposed to the boolean
interface we have now.
By extension, this also means the visualeditor-needcheck
tag won't be applied to new edits any more, although
its registration and messages are kept around because
edits with this tag still exist in page histories.
Bug: T87161
Change-Id: I909153492a5786b4b69fccd42ce3c1d4bdb3a059
Follows-up 0547d8c8.
It's still very difficult to test whether this code works, but
doing $( newDoc ).remove( 'selector1' ).remove( 'selector2' )...
demonstrably doesn't work, because 1) the selector passed to remove()
filters the collection, it doesn't descend into it, and 2) remove()
returns the collection of removed items, so chaining it doesn't work.
Instead, use $( newDoc ).find( 'selector1, selector2, ...' ).remove();
Also normalise selectors.
Change-Id: I97f3b28c4d5120f08e5d7fbf4598ddc0c01d4ecf
* Ensure that the toolbar remains inside the target so that
target triggers still work
* To keep the page title beneath the toolbar, move it inside
the target on setup, and restore it on teardown
* Have teardownToolBar/DebugBar return promises so we know
when teardown is completely finished.
Change-Id: If2a9ce9a653aed51d21c8e8dd7795f2533d54f70
* Use .ve-activated for elements changed in activate()
- hideReadOnlyContent()
- mutePageContent()
- mutePageTitle
* Use .ve-active for elements changed in onSurfaceReady()
- hidePageContent()
* Set 've-activated' class from activate() instead of transformPage()
to consolidate reflows and minimise DOM interaction. It's still
in the same (synchronous) execution path, but a few statements
earlier now.
* Remove obsolete #toc wrapper. This <div> (with data property
to distinguish it from potentially foreign parents in the future)
was there to aid slideDown/slideUp animations, because those
don't work well on table elements. See eba7d58dd1.
* Remove obsolete setTimeout in restorePageTitle().
The removal of .ve-init-mw-viewPageTarget-pageTitle was delayed
by one second (introduced in Ibc3fa2fb7 / 4cc88b9850). This
was to account for a jQuery animation we no longer use.
* Remove unused '.ve-init-mw-viewPageTarget-transform-muted'
* Remove unused '.ve-init-mw-viewPageTarget-transform'
* Remove unused '.ve-init-mw-viewPageTarget-pageTitle'
The resulting stylesheet exposes that we're not consistent in
whether elements hide immediately (ve-activated) or once the
surface is ready (ve-active). This is intentionally kept as-is
within this commit.
Of the different elements that had their opacity changed, only
firstHeading was being animated. This animation was removed.
Bug: T88590
Bug: T87160
Change-Id: I87033456f715d99a88425e38e8ac5171144f4ec8
We used to send data like { title: { missing: true|false } }
With this change, we send data like { missing: [titles], existing: true|[titles] }
where 'existing' is set to true (assume all non-missing titles exist)
for current revisions and to an array of existing titles for
old revisions.
This is because we always output this data for links in the current
revision, even when loading an old revision: in that case we rely
on the client to request the omitted information, so there we can't
assume that all pages we don't have information about exist.
Bug: T88259
Change-Id: I7b58b3f669cc78fd81b60859cf76928a9087066f
If added afterwards, this causes child elements styles with
'em'-values to get redrawn (or even animated).
Bug: T88387
Change-Id: Ic1aba14b7cfe0ff6e7191f0b6052ed9cc4585fcd
Its white overlay is pretty good at obscuring them, and the notices popup
would close when the dialog is closed, making it very easy to miss them.
Also fixed indentation.
Bug: T86987
Change-Id: I9f93c4169de98ef77a1eb33fd31a0ec524b6d2b7
* Add a class to the indentation toolbar button, similarly to what was done in
Ib0cb67151d893a5d2efccf798d6b25d197ed34d2
* Fix the definition of the indentation pull-down element acordingly.
* Restore the Indentation menu screenshot scenario, which was disabled in
I3e892baa9cb2c8c1303fab232a2b1c64ebdd8f26
Change-Id: If2d92aab6d04aa487d6f753fa7cac94f8d8215c8
I think somebody somewhere pointed to this as the reason why VE
wouldn't load when user's common.js has syntax errors, but I actually
can't reproduce that. Not sure if this is needed, but looks like a
good idea anyway.
(Once more, with feeling. Reverted broken attempt: aa531488.)
Change-Id: I252c5c20f75b3bbea51200560408dc4cfc7174f6
I think somebody somewhere pointed to this as the reason why VE
wouldn't load when user's common.js has syntax errors, but I actually
can't reproduce that. Not sure if this is needed, but looks like a
good idea anyway.
Change-Id: I3abecacf083c1c9dfb2ea30207a9911eeea54b50
This cleans up the selectors for the elements on the toolbar
so that they can be tested.
Class names in the form of ve-test-* are added to elements
that have words for labels: 'Paragraph', 'Cite', 'Insert'.
There is no other way to look up these elements in the DOM
except using the UI text, but it is different in different languages,
so this is unusable for the language_screenshots job,
which is multilingual by its nature.
Bug: T76143
Change-Id: Ib0cb67151d893a5d2efccf798d6b25d197ed34d2
MobileViewTarget.
Due to this being missed, pageName was getting set to a jQuery object,
which eventually got passed as a data value in a $.ajax call, causing
jQuery to emit a TypeError: Illegal invocation.
I guess this needs a MobileFrontend commit as well. Don't think it fixes
all the issues with loading VE mobile though.
Bug: T78710
Change-Id: I431a902563f608a7a33028cd60112f39c57000a4
Local changes:
* Call bindHandlers()/unbindHandlers() in activate/deactivate
* Extend onDocumentKeyDown rather than overwriting it
Change-Id: I0739e71781c5140c54512ab421bdcb6d1df5fbbe
Follows-up b0e8900, 447e8de, d3f26e65.
Contrary to binding a reference, this-overiddes for inline
functions gets messy and fragile. There's also a minor
performance overhead that can be avoided. No separation of
concerns, eiter, as the object is held by the closure.
Also:
* Remove left-over instances of @method.
* Remove redundant '0' argument to setTimeout.
* Use null instead of $ for apply() on static methods like $.when.
* Use .empty().append() instead of .html(). Does the same but
without additional overhead and without confusion association
with "html" which isn't used (it doesn't serialise and re-parse
or clone, it just appends when given one or more nodes).
Change-Id: I797a3667c67d52568150be9be5d043d149f22077
Various VE elements use escape to perform tasks. Particularly
difficult are OOUI dialogs which listen to the document and thus
fire after this target's listener, so defer and check if the
event was previously stopped.
Bug: T78201
Change-Id: Ie335f199766923833588202626c3af8e4cbcb9b5
New changes:
9929b6d [BREAKING CHANGE] Make ve.init.target an OO.ui.Element
Local changes:
* Fix target constructors now they generate this.$element
Change-Id: Ia6bf604c67305834a3f73863a10336cfbb83fa77
New changes:
776e801 Delimit text nodes in debug observations
72643bc Remove debug bar hiding now it is handled by the surface
cf1e167 [BREAKING CHANGE] Multiple surface support and demo
Local changes:
Account for detachable toolbars in core being setup in a different order.
Change-Id: I29156948711d55ba5f6dd4f6c35ca0e4cca32373