Changeset 140341 in webkit


Ignore:
Timestamp:
Jan 21, 2013 9:10:34 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Implement the HTML <main> element.
https://bugs.webkit.org/show_bug.cgi?id=103172

Patch by Michael[tm] Smith <sideshowbarker (Michael[tm] Smith)> on 2013-01-21
Reviewed by Chris Fleizach.

Source/WebCore:

Authored by Steve Faulkner <faulkner.steve@gmail.com>

<main> should behave the same as <nav>, <section>, and <article>, and <aside>.
<main> should expose AXLandmarkMain correctly on each platform.

Tests: fast/html/main-element.html

platform/chromium/accessibility/main-element.html
platform/mac/accessibility/main-element.html

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::determineAccessibilityRole):

  • css/html.css:

(article, aside, footer, header, hgroup, main, nav, section):

  • editing/FormatBlockCommand.cpp:

(WebCore::isElementForFormatBlock):

  • html/HTMLTagNames.in:
  • html/parser/HTMLStackItem.h:

(WebCore::HTMLStackItem::isSpecialNode):

  • html/parser/HTMLTreeBuilder.cpp:

(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::processEndTagForInBody):

LayoutTests:

<main> should behave the same as <nav>, <section>, <article>, and <aside>.
<main> has no specific parsing rules.
<main> should expose AXLandmarkMain correctly for each platform.

  • editing/execCommand/query-format-block-expected.txt:
  • editing/execCommand/remove-format-elements-expected.txt:
  • editing/execCommand/remove-format-elements.html:
  • editing/execCommand/script-tests/query-format-block.js:
  • fast/block/child-not-removed-from-parent-lineboxes-crash.html:
  • fast/dom/click-method-on-html-element-expected.txt:
  • fast/dom/click-method-on-html-element.html:
  • fast/dom/wrapper-classes-expected.txt:
  • fast/dom/wrapper-classes.html:
  • fast/forms/access-key-for-all-elements-expected.txt:
  • fast/forms/access-key-for-all-elements.html:
  • fast/html/main-element-expected.txt: Added.
  • fast/html/main-element.html: Added.
  • fast/html/script-tests/main-element.js: Added.

(getWeight):

  • platform/chromium/accessibility/main-element-expected.txt: Added.
  • platform/chromium/accessibility/main-element.html: Added.
  • platform/chromium/fast/dom/wrapper-classes-expected.txt:
  • platform/mac/accessibility/main-element-expected.txt: Added.
  • platform/mac/accessibility/main-element.html: Added.
Location:
trunk
Files:
7 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140340 r140341  
     12013-01-21  Michael[tm] Smith  <mike@w3.org>
     2
     3        Implement the HTML <main> element.
     4        https://bugs.webkit.org/show_bug.cgi?id=103172
     5
     6        Reviewed by Chris Fleizach.
     7
     8        <main> should behave the same as <nav>, <section>, <article>, and <aside>.
     9        <main> has no specific parsing rules.
     10        <main> should expose AXLandmarkMain correctly for each platform.
     11
     12        * editing/execCommand/query-format-block-expected.txt:
     13        * editing/execCommand/remove-format-elements-expected.txt:
     14        * editing/execCommand/remove-format-elements.html:
     15        * editing/execCommand/script-tests/query-format-block.js:
     16        * fast/block/child-not-removed-from-parent-lineboxes-crash.html:
     17        * fast/dom/click-method-on-html-element-expected.txt:
     18        * fast/dom/click-method-on-html-element.html:
     19        * fast/dom/wrapper-classes-expected.txt:
     20        * fast/dom/wrapper-classes.html:
     21        * fast/forms/access-key-for-all-elements-expected.txt:
     22        * fast/forms/access-key-for-all-elements.html:
     23        * fast/html/main-element-expected.txt: Added.
     24        * fast/html/main-element.html: Added.
     25        * fast/html/script-tests/main-element.js: Added.
     26        (getWeight):
     27        * platform/chromium/accessibility/main-element-expected.txt: Added.
     28        * platform/chromium/accessibility/main-element.html: Added.
     29        * platform/chromium/fast/dom/wrapper-classes-expected.txt:
     30        * platform/mac/accessibility/main-element-expected.txt: Added.
     31        * platform/mac/accessibility/main-element.html: Added.
     32
    1332013-01-21  Joanmarie Diggs  <jdiggs@igalia.com>
    234
  • trunk/LayoutTests/editing/execCommand/query-format-block-expected.txt

    r74603 r140341  
    7070PASS queryCommand('formatBlock') returned "header" selecting first position of "<header>hello</header>"
    7171PASS queryCommand('formatBlock') returned "hgroup" selecting first position of "<hgroup>hello</hgroup>"
     72PASS queryCommand('formatBlock') returned "main" selecting first position of "<main>hello</main>"
    7273PASS queryCommand('formatBlock') returned "nav" selecting first position of "<nav>hello</nav>"
    7374PASS queryCommand('formatBlock') returned "p" selecting first position of "<p>hello</p>"
  • trunk/LayoutTests/editing/execCommand/remove-format-elements-expected.txt

    r70285 r140341  
    22acronym, b, bdo, big, cite, code, dfn, em, font, i, ins, kbd, nobr, q, s, samp, small, strike, strong, sub, sup, tt, u, var
    33Preserved
    4 noscript, a, abbr, address, applet, area, article, aside, audio, base, basefont, bgsound, blockquote, body, br, button, canvas, caption, center, col, colgroup, command, datagrid, datalist, dcell, dcol, dd, del, details, dir, div, dl, drow, dt, embed, fieldset, figcaption, figure, footer, form, frame, frameset, h1, h2, h3, h4, h5, h6, head, header, hgroup, hr, html, iframe, image, img, input, isindex, keygen, label, layer, legend, li, link, listing, map, mark, marquee, menu, meta, meter, nav, noembed, noframes, nolayer, noscript, object, ol, optgroup, option, p, param, plaintext, pre, progress, rp, rt, ruby, script, section, select, source, span, style, summary, table, tbody, td, textarea, tfoot, th, thead, title, tr, track, ul, video, wbr, xmp
     4noscript, a, abbr, address, applet, area, article, aside, audio, base, basefont, bgsound, blockquote, body, br, button, canvas, caption, center, col, colgroup, command, datagrid, datalist, dcell, dcol, dd, del, details, dir, div, dl, drow, dt, embed, fieldset, figcaption, figure, footer, form, frame, frameset, h1, h2, h3, h4, h5, h6, head, header, hgroup, hr, html, iframe, image, img, input, isindex, keygen, label, layer, legend, li, link, listing, main, map, mark, marquee, menu, meta, meter, nav, noembed, noframes, nolayer, noscript, object, ol, optgroup, option, p, param, plaintext, pre, progress, rp, rt, ruby, script, section, select, source, span, style, summary, table, tbody, td, textarea, tfoot, th, thead, title, tr, track, ul, video, wbr, xmp
    55Exceptions
    66
  • trunk/LayoutTests/editing/execCommand/remove-format-elements.html

    r120173 r140341  
    2323"h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html",
    2424"i", "iframe", "image", "img", "input", "ins", "isindex", "kbd", "keygen", "label", "layer", "legend", ["ul", "li"], "link", "listing",
    25 "map", "mark", "marquee", "menu", "meta", "meter", "nav", "nobr", "noembed", "noframes", "nolayer", "noscript",
     25"main", "map", "mark", "marquee", "menu", "meta", "meter", "nav", "nobr", "noembed", "noframes", "nolayer", "noscript",
    2626"object", "ol", "optgroup", "option", "p", "param", "plaintext", "pre", "progress", "q", "rp", "rt", "ruby",
    2727"s", "samp", "script", "section", "select", "small", "source", "span", "strike", "strong", "style", "sub", "summary", "sup",
  • trunk/LayoutTests/editing/execCommand/script-tests/query-format-block.js

    r74603 r140341  
    102102queryFormatBlock(selectFirstPosition, '<header>hello</header>', 'header');
    103103queryFormatBlock(selectFirstPosition, '<hgroup>hello</hgroup>', 'hgroup');
     104queryFormatBlock(selectFirstPosition, '<main>hello</main>', 'main');
    104105queryFormatBlock(selectFirstPosition, '<nav>hello</nav>', 'nav');
    105106queryFormatBlock(selectFirstPosition, '<p>hello</p>', 'p');
  • trunk/LayoutTests/fast/block/child-not-removed-from-parent-lineboxes-crash.html

    r120681 r140341  
    66    testRunner.dumpAsText();
    77
    8 var tags = ['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdo', 'bgsound', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'datagrid', 'datalist', 'dcell', 'dcol', 'drow', 'dd', 'del', 'details', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'child', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'layer', 'legend', 'li', 'link', 'listing', 'map', 'mark', 'marquee', 'menu', 'meta', 'meter', 'nav', 'nobr', 'noembed', 'noframes', 'nolayer', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'plaintext', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp', 'noscript', 'noscript', 'math', 'mfrac', 'mfenced', 'msubsup', 'mrow', 'mover', 'munder', 'munderover', 'msqrt', 'mroot', 'mi', 'mn', 'mo', 'mtext', 'msub', 'msup', 'ms', 'mglyph', 'malignmark', 'annotation-xml', 'a', 'access', 'anchor', 'br', 'card', 'do', 'fieldset', 'go', 'head', 'img', 'input', 'insertedLegend', 'meta', 'noop', 'onevent', 'optgroup', 'option', 'p', 'postfield', 'prev', 'refresh', 'select', 'setvar', 'table', 'td', 'template', 'timer', 'tr', 'a', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor', 'animateMotion', 'animateTransform', 'set', 'circle', 'clipPath', 'color_profile', 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter', 'font', 'font_face', 'font_face_format', 'font_face_name', 'font_face_src', 'font_face_uri', 'foreignObject', 'g', 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'missing_glyph', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'script', 'stop', 'style', 'svg', 'switch', 'symbol', 'text', 'textPath', 'title', 'tref', 'tspan', 'use', 'view', 'vkern']
     8var tags = ['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdo', 'bgsound', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'datagrid', 'datalist', 'dcell', 'dcol', 'drow', 'dd', 'del', 'details', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'child', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'layer', 'legend', 'li', 'link', 'listing', 'main', 'map', 'mark', 'marquee', 'menu', 'meta', 'meter', 'nav', 'nobr', 'noembed', 'noframes', 'nolayer', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'plaintext', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp', 'noscript', 'noscript', 'math', 'mfrac', 'mfenced', 'msubsup', 'mrow', 'mover', 'munder', 'munderover', 'msqrt', 'mroot', 'mi', 'mn', 'mo', 'mtext', 'msub', 'msup', 'ms', 'mglyph', 'malignmark', 'annotation-xml', 'a', 'access', 'anchor', 'br', 'card', 'do', 'fieldset', 'go', 'head', 'img', 'input', 'insertedLegend', 'meta', 'noop', 'onevent', 'optgroup', 'option', 'p', 'postfield', 'prev', 'refresh', 'select', 'setvar', 'table', 'td', 'template', 'timer', 'tr', 'a', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor', 'animateMotion', 'animateTransform', 'set', 'circle', 'clipPath', 'color_profile', 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter', 'font', 'font_face', 'font_face_format', 'font_face_name', 'font_face_src', 'font_face_uri', 'foreignObject', 'g', 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'missing_glyph', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'script', 'stop', 'style', 'svg', 'switch', 'symbol', 'text', 'textPath', 'title', 'tref', 'tspan', 'use', 'view', 'vkern']
    99
    1010for (i = 0; i < tags.length; i++)
  • trunk/LayoutTests/fast/dom/click-method-on-html-element-expected.txt

    r107483 r140341  
    7272Pass: Click event handler called for: link
    7373Pass: Click event handler called for: listing
     74Pass: Click event handler called for: main
    7475Pass: Click event handler called for: map
    7576Pass: Click event handler called for: mark
  • trunk/LayoutTests/fast/dom/click-method-on-html-element.html

    r107483 r140341  
    2727    "body","br","button","canvas","caption","center","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","dir","div","dl","dt",
    2828    "em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html",
    29     "i","iframe","img","input","ins","isindex","kbd","keygen","label","layer","legend","li","link","listing","map","mark","marquee","menu","meta","meter","nav",
     29    "i","iframe","img","input","ins","isindex","kbd","keygen","label","layer","legend","li","link","listing","main","map","mark","marquee","menu","meta","meter","nav",
    3030    "nobr","noembed","noframes","nolayer","noscript","object","ol","optgroup","option","output","p","param","plaintext","pre","progress","q","rp","rt","ruby","s",
    3131    "samp","script","section","select","small","source","span","strike","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead",
  • trunk/LayoutTests/fast/dom/wrapper-classes-expected.txt

    r135093 r140341  
    342342PASS tagJSWrapperPrototypeClass('listing') is 'HTMLPreElementPrototype'
    343343PASS tagJSWrapperConstructorClass('listing') is 'HTMLPreElementConstructor'
     344PASS tagJSWrapperClass('main') is 'HTMLElement'
     345PASS tagJSWrapperPrototypeClass('main') is 'HTMLElementPrototype'
     346PASS tagJSWrapperConstructorClass('main') is 'HTMLElementConstructor'
    344347PASS tagJSWrapperClass('map') is 'HTMLMapElement'
    345348PASS tagJSWrapperPrototypeClass('map') is 'HTMLMapElementPrototype'
  • trunk/LayoutTests/fast/dom/wrapper-classes.html

    r123300 r140341  
    213213    testTag("link", "HTMLLinkElement");
    214214    testTag("listing", "HTMLPreElement");
     215    testTag("main", "HTMLElement");
    215216    testTag("map", "HTMLMapElement");
    216217    testTag("marquee", "HTMLMarqueeElement");
  • trunk/LayoutTests/fast/forms/access-key-for-all-elements-expected.txt

    r100805 r140341  
    339339PASS pressKey(testElement.accessKey);[clicked, focused] is [true, false]
    340340
     341Check for MAIN tag
     342PASS testElement.accessKey is defined.
     343PASS testElement.accessKey ='k'; testElement.accessKey == 'k' is true
     344PASS pressKey(testElement.accessKey);[clicked, focused] is [true, false]
     345
    341346Check for MAP tag
    342347PASS testElement.accessKey is defined.
  • trunk/LayoutTests/fast/forms/access-key-for-all-elements.html

    r100805 r140341  
    2020    "body","br","canvas","caption","center","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","dir","div","dl","dt",
    2121    "em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html",
    22     "i","iframe","img","ins","kbd","keygen","label","layer","li","link","listing","map","mark","marquee","menu","meta","meter","nav",
     22    "i","iframe","img","ins","kbd","keygen","label","layer","li","link","listing","main","map","mark","marquee","menu","meta","meter","nav",
    2323    "nobr","noembed","noframes","nolayer","noscript","object","ol","output","p","param","plaintext","pre","progress","q","rp","rt","ruby","s",
    2424    "samp","script","section","small","source","span","strike","strong","style","sub","summary","sup","table","tbody","td","tfoot","th","thead",
  • trunk/LayoutTests/platform/chromium/fast/dom/wrapper-classes-expected.txt

    r108729 r140341  
    342342FAIL tagJSWrapperPrototypeClass('listing') should be HTMLPreElementPrototype. Was Object.
    343343FAIL tagJSWrapperConstructorClass('listing') should be HTMLPreElementConstructor. Was Function.
     344PASS tagJSWrapperClass('main') is 'HTMLElement'
     345FAIL tagJSWrapperPrototypeClass('main') should be HTMLElementPrototype. Was Object.
     346FAIL tagJSWrapperConstructorClass('main') should be HTMLElementConstructor. Was Function.
    344347PASS tagJSWrapperClass('map') is 'HTMLMapElement'
    345348FAIL tagJSWrapperPrototypeClass('map') should be HTMLMapElementPrototype. Was Object.
  • trunk/Source/WebCore/ChangeLog

    r140340 r140341  
     12013-01-21  Michael[tm] Smith  <mike@w3.org>
     2
     3        Implement the HTML <main> element.
     4        https://bugs.webkit.org/show_bug.cgi?id=103172
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Authored by Steve Faulkner <faulkner.steve@gmail.com>
     9
     10        <main> should behave the same as <nav>, <section>, and <article>, and <aside>.
     11        <main> should expose AXLandmarkMain correctly on each platform.
     12
     13        Tests: fast/html/main-element.html
     14               platform/chromium/accessibility/main-element.html
     15               platform/mac/accessibility/main-element.html
     16
     17        * accessibility/AccessibilityRenderObject.cpp:
     18        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
     19        * css/html.css:
     20        (article, aside, footer, header, hgroup, main, nav, section):
     21        * editing/FormatBlockCommand.cpp:
     22        (WebCore::isElementForFormatBlock):
     23        * html/HTMLTagNames.in:
     24        * html/parser/HTMLStackItem.h:
     25        (WebCore::HTMLStackItem::isSpecialNode):
     26        * html/parser/HTMLTreeBuilder.cpp:
     27        (WebCore::HTMLTreeBuilder::processStartTagForInBody):
     28        (WebCore::HTMLTreeBuilder::processEndTagForInBody):
     29
    1302013-01-21  Joanmarie Diggs  <jdiggs@igalia.com>
    231
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r139663 r140341  
    25382538        return DocumentArticleRole;
    25392539
     2540    if (node && node->hasTagName(mainTag))
     2541        return LandmarkMainRole;
     2542
    25402543    if (node && node->hasTagName(navTag))
    25412544        return LandmarkNavigationRole;
  • trunk/Source/WebCore/css/html.css

    r140097 r140341  
    8282}
    8383
    84 article, aside, footer, header, hgroup, nav, section {
     84article, aside, footer, header, hgroup, main, nav, section {
    8585    display: block
    8686}
  • trunk/Source/WebCore/editing/FormatBlockCommand.cpp

    r89683 r140341  
    137137        blockTags.add(headerTag);
    138138        blockTags.add(hgroupTag);
     139        blockTags.add(mainTag);
    139140        blockTags.add(navTag);
    140141        blockTags.add(pTag);
  • trunk/Source/WebCore/html/HTMLTagNames.in

    r140097 r140341  
    8181link constructorNeedsCreatedByParser
    8282listing interfaceName=HTMLPreElement
     83main interfaceName=HTMLElement
    8384map
    8485mark interfaceName=HTMLElement
  • trunk/Source/WebCore/html/parser/HTMLStackItem.h

    r126355 r140341  
    169169            || tagName == HTMLNames::linkTag
    170170            || tagName == HTMLNames::listingTag
     171            || tagName == HTMLNames::mainTag
    171172            || tagName == HTMLNames::marqueeTag
    172173            || tagName == HTMLNames::menuTag
  • trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp

    r139959 r140341  
    692692        || token->name() == headerTag
    693693        || token->name() == hgroupTag
     694        || token->name() == mainTag
    694695        || token->name() == menuTag
    695696        || token->name() == navTag
     
    18171818        || token->name() == hgroupTag
    18181819        || token->name() == listingTag
     1820        || token->name() == mainTag
    18191821        || token->name() == menuTag
    18201822        || token->name() == navTag
Note: See TracChangeset for help on using the changeset viewer.