summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/libeditor/HTMLEditUtils.cpp66
1 files changed, 32 insertions, 34 deletions
diff --git a/editor/libeditor/HTMLEditUtils.cpp b/editor/libeditor/HTMLEditUtils.cpp
index 7933637fe..89abbe49c 100644
--- a/editor/libeditor/HTMLEditUtils.cpp
+++ b/editor/libeditor/HTMLEditUtils.cpp
@@ -603,9 +603,11 @@ static const ElementInfo kElements[eHTMLTag_userdefined] = {
ELEM(a, true, false, GROUP_SPECIAL, GROUP_INLINE_ELEMENT),
ELEM(abbr, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
ELEM(acronym, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
- ELEM(address, true, true, GROUP_BLOCK,
- GROUP_INLINE_ELEMENT | GROUP_P),
- ELEM(applet, true, true, GROUP_SPECIAL | GROUP_BLOCK,
+ ELEM(address, true, true, GROUP_BLOCK, GROUP_INLINE_ELEMENT | GROUP_P),
+ ELEM(applet,
+ true,
+ true,
+ GROUP_SPECIAL | GROUP_BLOCK,
GROUP_FLOW_ELEMENT | GROUP_OBJECT_CONTENT),
ELEM(area, false, false, GROUP_MAP_CONTENT, GROUP_NONE),
ELEM(article, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
@@ -620,19 +622,24 @@ static const ElementInfo kElements[eHTMLTag_userdefined] = {
ELEM(blockquote, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
ELEM(body, true, true, GROUP_TOPLEVEL, GROUP_FLOW_ELEMENT),
ELEM(br, false, false, GROUP_SPECIAL, GROUP_NONE),
- ELEM(button, true, true, GROUP_FORMCONTROL | GROUP_BLOCK,
- GROUP_FLOW_ELEMENT),
+ ELEM(button, true, true, GROUP_FORMCONTROL | GROUP_BLOCK, GROUP_FLOW_ELEMENT),
ELEM(canvas, false, false, GROUP_NONE, GROUP_NONE),
ELEM(caption, true, true, GROUP_NONE, GROUP_INLINE_ELEMENT),
ELEM(center, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
ELEM(cite, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
ELEM(code, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
- ELEM(col, false, false, GROUP_TABLE_CONTENT | GROUP_COLGROUP_CONTENT,
+ ELEM(col,
+ false,
+ false,
+ GROUP_TABLE_CONTENT | GROUP_COLGROUP_CONTENT,
GROUP_NONE),
ELEM(colgroup, true, false, GROUP_NONE, GROUP_COLGROUP_CONTENT),
ELEM(content, true, false, GROUP_NONE, GROUP_INLINE_ELEMENT),
ELEM(data, true, false, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
- ELEM(datalist, true, false, GROUP_PHRASE,
+ ELEM(datalist,
+ true,
+ false,
+ GROUP_PHRASE,
GROUP_OPTIONS | GROUP_INLINE_ELEMENT),
ELEM(dd, true, false, GROUP_DL_CONTENT, GROUP_FLOW_ELEMENT),
ELEM(del, true, true, GROUP_PHRASE | GROUP_BLOCK, GROUP_FLOW_ELEMENT),
@@ -647,33 +654,25 @@ static const ElementInfo kElements[eHTMLTag_userdefined] = {
ELEM(embed, false, false, GROUP_NONE, GROUP_NONE),
ELEM(fieldset, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
ELEM(figcaption, true, false, GROUP_FIGCAPTION, GROUP_FLOW_ELEMENT),
- ELEM(figure, true, true, GROUP_BLOCK,
- GROUP_FLOW_ELEMENT | GROUP_FIGCAPTION),
+ ELEM(figure, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT | GROUP_FIGCAPTION),
ELEM(font, true, true, GROUP_SPECIAL, GROUP_INLINE_ELEMENT),
ELEM(footer, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
ELEM(form, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
ELEM(frame, false, false, GROUP_FRAME, GROUP_NONE),
ELEM(frameset, true, true, GROUP_FRAME, GROUP_FRAME),
- ELEM(h1, true, false, GROUP_BLOCK | GROUP_HEADING,
- GROUP_INLINE_ELEMENT),
- ELEM(h2, true, false, GROUP_BLOCK | GROUP_HEADING,
- GROUP_INLINE_ELEMENT),
- ELEM(h3, true, false, GROUP_BLOCK | GROUP_HEADING,
- GROUP_INLINE_ELEMENT),
- ELEM(h4, true, false, GROUP_BLOCK | GROUP_HEADING,
- GROUP_INLINE_ELEMENT),
- ELEM(h5, true, false, GROUP_BLOCK | GROUP_HEADING,
- GROUP_INLINE_ELEMENT),
- ELEM(h6, true, false, GROUP_BLOCK | GROUP_HEADING,
- GROUP_INLINE_ELEMENT),
+ ELEM(h1, true, false, GROUP_BLOCK | GROUP_HEADING, GROUP_INLINE_ELEMENT),
+ ELEM(h2, true, false, GROUP_BLOCK | GROUP_HEADING, GROUP_INLINE_ELEMENT),
+ ELEM(h3, true, false, GROUP_BLOCK | GROUP_HEADING, GROUP_INLINE_ELEMENT),
+ ELEM(h4, true, false, GROUP_BLOCK | GROUP_HEADING, GROUP_INLINE_ELEMENT),
+ ELEM(h5, true, false, GROUP_BLOCK | GROUP_HEADING, GROUP_INLINE_ELEMENT),
+ ELEM(h6, true, false, GROUP_BLOCK | GROUP_HEADING, GROUP_INLINE_ELEMENT),
ELEM(head, true, false, GROUP_TOPLEVEL, GROUP_HEAD_CONTENT),
ELEM(header, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
ELEM(hgroup, true, false, GROUP_BLOCK, GROUP_HEADING),
ELEM(hr, false, false, GROUP_BLOCK, GROUP_NONE),
ELEM(html, true, false, GROUP_TOPLEVEL, GROUP_TOPLEVEL),
ELEM(i, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
- ELEM(iframe, true, true, GROUP_SPECIAL | GROUP_BLOCK,
- GROUP_FLOW_ELEMENT),
+ ELEM(iframe, true, true, GROUP_SPECIAL | GROUP_BLOCK, GROUP_FLOW_ELEMENT),
ELEM(image, false, false, GROUP_NONE, GROUP_NONE),
ELEM(img, false, false, GROUP_SPECIAL | GROUP_PICTURE_CONTENT, GROUP_NONE),
ELEM(input, false, false, GROUP_FORMCONTROL, GROUP_NONE),
@@ -699,15 +698,15 @@ static const ElementInfo kElements[eHTMLTag_userdefined] = {
ELEM(noembed, false, false, GROUP_NONE, GROUP_NONE),
ELEM(noframes, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
ELEM(noscript, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
- ELEM(object, true, true, GROUP_SPECIAL | GROUP_BLOCK,
+ ELEM(object,
+ true,
+ true,
+ GROUP_SPECIAL | GROUP_BLOCK,
GROUP_FLOW_ELEMENT | GROUP_OBJECT_CONTENT),
// XXX Can contain self and ul because editor does sublists illegally.
- ELEM(ol, true, true, GROUP_BLOCK | GROUP_OL_UL,
- GROUP_LI | GROUP_OL_UL),
- ELEM(optgroup, true, false, GROUP_SELECT_CONTENT,
- GROUP_OPTIONS),
- ELEM(option, true, false,
- GROUP_SELECT_CONTENT | GROUP_OPTIONS, GROUP_LEAF),
+ ELEM(ol, true, true, GROUP_BLOCK | GROUP_OL_UL, GROUP_LI | GROUP_OL_UL),
+ ELEM(optgroup, true, false, GROUP_SELECT_CONTENT, GROUP_OPTIONS),
+ ELEM(option, true, false, GROUP_SELECT_CONTENT | GROUP_OPTIONS, GROUP_LEAF),
ELEM(output, true, true, GROUP_SPECIAL, GROUP_INLINE_ELEMENT),
ELEM(p, true, false, GROUP_BLOCK | GROUP_P, GROUP_INLINE_ELEMENT),
ELEM(param, false, false, GROUP_OBJECT_CONTENT, GROUP_NONE),
@@ -723,11 +722,11 @@ static const ElementInfo kElements[eHTMLTag_userdefined] = {
ELEM(ruby, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
ELEM(s, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
ELEM(samp, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
- ELEM(script, true, false, GROUP_HEAD_CONTENT | GROUP_SPECIAL,
- GROUP_LEAF),
+ ELEM(script, true, false, GROUP_HEAD_CONTENT | GROUP_SPECIAL, GROUP_LEAF),
ELEM(section, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
ELEM(select, true, false, GROUP_FORMCONTROL, GROUP_SELECT_CONTENT),
ELEM(small, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
+ ELEM(slot, true, false, GROUP_NONE, GROUP_FLOW_ELEMENT),
ELEM(source, false, false, GROUP_PICTURE_CONTENT, GROUP_NONE),
ELEM(span, true, true, GROUP_SPECIAL, GROUP_INLINE_ELEMENT),
ELEM(strike, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
@@ -751,8 +750,7 @@ static const ElementInfo kElements[eHTMLTag_userdefined] = {
ELEM(tt, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
ELEM(u, true, true, GROUP_FONTSTYLE, GROUP_INLINE_ELEMENT),
// XXX Can contain self and ol because editor does sublists illegally.
- ELEM(ul, true, true, GROUP_BLOCK | GROUP_OL_UL,
- GROUP_LI | GROUP_OL_UL),
+ ELEM(ul, true, true, GROUP_BLOCK | GROUP_OL_UL, GROUP_LI | GROUP_OL_UL),
ELEM(var, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
ELEM(video, false, false, GROUP_NONE, GROUP_NONE),
ELEM(wbr, false, false, GROUP_NONE, GROUP_NONE),