Skip to content

Commit 744728d

Browse files
piotrtomiakintellij-monorepo-bot
authored andcommitted
[html] WEB-72823 Fix acquiring MDN documentation for <input> element; update MDN docs
(cherry picked from commit 27406bc89c532ef4d61ffb751fe50a4eead11080) IJ-CR-178017 GitOrigin-RevId: 03cf87518a337f6f2610e4cf7a8a3e042b0b0efa
1 parent 7a1d0ac commit 744728d

File tree

14 files changed

+1077
-975
lines changed

14 files changed

+1077
-975
lines changed

xml/tests/src/com/intellij/html/HtmlDocumentationTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ public void testAttributeQuickDocAtTheEndOfFile() {
152152
);
153153
}
154154

155+
public void testInputAttributeQuickDoc() {
156+
myFixture.configureByText("attributeQuickDocAtTheEndOfFile.html", "<input type='button' popover<caret>targetaction>");
157+
WebTestUtil.checkDocumentationAtCaret(myFixture);
158+
}
159+
155160
public void testLookupDocWordCompletions() {
156161
myFixture.configureByText("test.html", "<html lang='en'>la<caret>n");
157162
PsiElement originalElement = myFixture.getFile().findElementAt(myFixture.getEditor().getCaretModel().getOffset());
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<div class='definition'><pre>popovertargetaction</pre></div>
2+
<div class='content'><details class='mdn-baseline'><summary>
3+
<table class='mdn-baseline'><tr><td width=2 valign=top class='mdn-baseline-icon'><icon src='com.intellij.xml.psi.impl.icons.XmlPsiImplIcons.BaselineLow'></icon>
4+
<td class='mdn-baseline-info'>Newly available across major browsers
5+
</td></tr></table></summary>
6+
<p><span class='grayed'>Chrome&nbsp;114, Chrome Android&nbsp;114, Edge&nbsp;114, Firefox&nbsp;125, Firefox Android&nbsp;125, Opera&nbsp;100, Safari&nbsp;17, Safari iOS&nbsp;17</span>
7+
<p class='grayed'>Baseline since 2024
8+
</details>
9+
Specifies the action to be performed on a popover element being controlled by a control <code>&lt;input type="button"&gt;</code>. Possible values are:
10+
<dl>
11+
<dt id="hide"><a href="https://developer.mozilla.org/en-us/docs/web/html/reference/elements/input#popovertargetaction#hide"><code>"hide"</code></a></dt>
12+
<dd>
13+
<p>The button will hide a shown popover. If you try to hide an already hidden popover, no action will be taken.
14+
</dd>
15+
<dt id="show"><a href="https://developer.mozilla.org/en-us/docs/web/html/reference/elements/input#popovertargetaction#show"><code>"show"</code></a></dt>
16+
<dd>
17+
<p>The button will show a hidden popover. If you try to show an already showing popover, no action will be taken.
18+
</dd>
19+
<dt id="toggle"><a href="https://developer.mozilla.org/en-us/docs/web/html/reference/elements/input#popovertargetaction#toggle"><code>"toggle"</code></a></dt>
20+
<dd>
21+
<p>The button will toggle a popover between showing and hidden. If the popover is hidden, it will be shown; if the popover is showing, it will be hidden. If <code>popovertargetaction</code> is omitted, <code>"toggle"</code> is the default action that will be performed by the control button.
22+
</dd>
23+
</dl></div>
24+
<div class='content'>By <a href='https://developer.mozilla.org/en-us/docs/web/html/reference/elements/input#popovertargetaction/contributors.txt'>Mozilla Contributors</a>, <a href='https://creativecommons.org/licenses/by-sa/2.5/'>CC BY-SA 2.5</a></div>

xml/xml-psi-impl/mdn-doc-gen/src/GenerateMdnDocumentation.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,14 @@ class GenerateMdnDocumentation : BasePlatformTestCase() {
401401

402402
val elementDoc = contents.prose.first().getProseContent().appendOtherSections(contents.prose)
403403

404-
val attributesDoc = contents.prose.filterProseById("attributes", "attributes_for_form_submission", "deprecated_attributes",
405-
"obsolete_attributes",
406-
"non-standard_attributes")
404+
val attributesDoc = contents.prose.filterProseById(
405+
"attributes",
406+
"individual_attributes",
407+
"attributes_for_form_submission",
408+
"deprecated_attributes",
409+
"obsolete_attributes",
410+
"non-standard_attributes",
411+
)
407412
.joinToString("\n") { it.getProseContent().content }
408413
.let { RawProse(it) }
409414

xml/xml-psi-impl/resources-gen/com/intellij/documentation/mdn/Css.json

Lines changed: 281 additions & 174 deletions
Large diffs are not rendered by default.

xml/xml-psi-impl/resources-gen/com/intellij/documentation/mdn/GlobalObjects.json

Lines changed: 7 additions & 4 deletions
Large diffs are not rendered by default.

xml/xml-psi-impl/resources-gen/com/intellij/documentation/mdn/Html.json

Lines changed: 94 additions & 42 deletions
Large diffs are not rendered by default.

xml/xml-psi-impl/resources-gen/com/intellij/documentation/mdn/MathML.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
},
1010
"lang": "en-us",
1111
"attrs": {
12+
"data-_star_": {
13+
"url": "$MDN_URL$/web/mathml/reference/global_attributes/data-_star_",
14+
"doc": "The <strong><code>data-*</code></strong> MathML attributes are called custom data attributes. They let MathML markup and its resulting DOM share information that standard attributes can't, usually for scripting purposes. Their custom data are available via the <a href=\"$MDN_URL$/Web/API/MathMLElement\"><code>MathMLElement</code></a> interface of the element the attributes belong to, with the <a href=\"$MDN_URL$/Web/API/MathMLElement/dataset\"><code>MathMLElement.dataset</code></a> property.\n<p>The <code>*</code> can be replaced by any characters allowed in <a href=\"https://www.w3.org/TR/xml/#NT-Name\" class=\"external\" target=\"_blank\">XML's rules for names</a>, with the following restrictions:\n<ul>\n<li>Can't start with <code>xml</code>.</li>\n<li>No semicolons (<code>;</code>, <code>U+003A</code>).</li>\n<li>No capital <code>A</code> to <code>Z</code> letters.</li>\n</ul>\n<div class=\"notecard note\">\n<p><strong>Note:</strong>\nThe <a href=\"$MDN_URL$/Web/API/MathMLElement/dataset\"><code>MathMLElement.dataset</code></a> property is a <a href=\"$MDN_URL$/Web/API/DOMStringMap\"><code>DOMStringMap</code></a> that provides the attribute <code>data-test-value</code> via <code>MathMLElement.dataset.testValue</code>. Hyphen characters (<code>-</code>, <code>U+002D</code>) are removed and the next letter is capitalized, resulting in the <a href=\"$MDN_URL$/Glossary/Camel_case\">camel case</a> format.\n</div>\n<p>You can use this attribute with any MathML element."
15+
},
1216
"dir": {
1317
"url": "$MDN_URL$/web/mathml/reference/global_attributes/dir",
1418
"status": [

0 commit comments

Comments
 (0)