MWTransclusionNode will preserve TemplateData <style> in its generated content.
Disable TemplateStyles stylesheets in the original page content, and reenable
them when the surface deactivates.
Remaining TODO: if multiple copies of a template with deduplicated styles are
on the page, and the one containing the actual <style> is removed, all will
lose their styling.
Bug: T197563
Change-Id: Ibd8939eef7d8eb532719f4ee0ce200600449ef81
Depends-On: Ia9f2afcdba5456238e3ef444c202c9b0c78838bf
It contains some rare options that we don't currently make editable,
and we don't set it when creating new image nodes.
We could change our code to always set it, and consider it required,
but that would theoretically be a break in backwards-compatibility.
Bug: T198660
Change-Id: I6e77cce257f733f0f8f6e896b967177ff01658c6
jQuery.makeCollapsible styles now display "fake" expand/collapse
toggles. This is nice, but some bits and pieces clashed with our
styles, this fixes it.
Also ensure that the styles are loaded if the page previously had no
collapsible elements on it.
Bug: T194323
Change-Id: If8f0869e6677811147f272337da7d96286792fe0
Pass through the current document when available, otherwise
assume the current surface's document.
Also add a getter for getPageName, so that can vary based
on the target document.
Bug: T193856
Change-Id: Ifdc951fdc6a43b924d102e3fcd7e59e52023757b
The bug is easiest to reproduce with `[[File:Example.jpg|link=]]`,
but it also affected video embeds.
jQuery appendTo() method returns the set of inserted elements.
Because `this.$element` is undefined at this point, the `<img>`
was not actually being inserted anywhere, and an empty set was
returned, causing MWInlineImageNode to have no CE rendering.
This was not an issue prior to c4f93b14, because `this.$element`
was being defined by the parent constructor (OO.ui.Element)
We don't actually want to insert it anywhere, this appendTo()
call was a remnant of wrapping code removed in a22aeafc.
Bug: T191406
Change-Id: If1dbf9fef0e0ac9debfdb3049ebcccac70948515
Overriding ve.ce.BranchNode#onSplice seems pretty scary, some bug
could cause two captions to be inserted and it wouldn't even be
visible in the editor.
Instead, allow normal splice handling to happen when the caption is
added/removed, and only override the position where it is inserted
(to account for the image node this.$a).
The caption node is already removed from DM/CE if the image type is
changed to one that doesn't have captions, and even if that failed it
is also hidden in CSS, so we don't need to handle this.
Change-Id: I54f52b288118d692708311512dd674cc85d5d9e3
After change 89aecd54ba (2014),
there is no 'border' value for the 'type' attribute, instead
there is a 'borderImage' attribute only present when 'type'
is 'none' or 'frameless'.
Change-Id: Id87ba09b647f5f69b1c9350209e66acdea2c9d69
MWBlockImageNode already can't have any slugs:
* It can't have inline slugs, because it can't directly contain
content (`this.canHaveChildrenNotContent()` is true)
* It can't have block slugs, because it can't contain paragraphs
(`this.isAllowedChildNodeType( 'paragraph' )` is false).
(The only thing it can contain is a mwImageCaption.)
Change-Id: Ice6505da2356f004ef048ed0b1a9e03d08af02d1
For galleries with 0 items, this would previously return an empty
jQuery collection, which caused funny rendering issues later.
Bug: T75230
Change-Id: Ia68e4f1b74b5ec494fa3d86f0b792f69eadb02fb
We emit <span id="..." typeof="mw:FallbackId"></span> inside headings
when necessary to provide backward compatibility with pre-HTML5
section ids. These are mostly harmless inside VE --- they become hidden
alienated nodes, which are then safely ignored by Parsoid during html2wt
even if they manage to migrate outside of a heading --- but it's a
little safer to strip them.
Change-Id: I07d0fcf54427ab02d4930cff183d3e5579a99306
* Look inside first child for autoGenerated (as reflists can be wrapped)
* Unwrap Parsoid sections
* Discard leading and trailing whitespace
Bug: T179618
Change-Id: Ib9ead28173360f0f1d5a4dc66c33a75d70ef34b3
Override ve.ce.FocusableNode#hasRendering with a model-based test to
improve efficiency and avoid some unnecessary DOM measurements.
Change-Id: Ice7aebcc2f30dc73ef049a6ed0d4a0cffe86d8e2
Also:
* Disconnect change event on this.input, which doesn't
get destroyed on teardown
* Add padding between attributes and this.input
* Assume the alien extensions can have a rendering when
their body is empty.
Bug: T177181
Bug: T177183
Change-Id: I2e59f8195b255f33f91901213c92ea14793635b4
The default value of target#pageName is wgRelevantPageName
but other targets my override this, or change it dynamically
(e.g. ContentTranslation).
Also remove duplicate setter of pageName in mw.ArticleTarget,
already set in mw.Target.
Change-Id: Iebd1def1d4142978a673afec584a0b663644d176
Avoid confusion by using `twoway` instead of `bidir`, which could be
confused with the Unicode bidirectional layout algorithm.
Depends-On: Ib59dff22e64f235e30778a5a5b3e525e4fc7fdd3
Change-Id: I7efb35245d48125b167dc0f0ef8f12aa0fff94e5