Uploaded image for project: 'SonarHTML'
  1. SonarHTML
  2. SONARHTML-90

Fix node hierarchy for html "void elements"

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Parsing
    • Labels:
      None

      Description

      Html specification define a list of void elements that cannot have any child nodes and for witch the end tag or self-closing tag is optional.

      complete list of the void elements in HTML : area, base, br, col, command, embed, hr, img, input, keygen, link, meta, param, source, track, wbr

      Our html parser creates a wrong node hierarchy for elements following a void element. Considering them as children and not siblings.
      For exemple, in <br><p></p>, br end tag is not missing and p is a sibling of br and not a child.
      It's like if void elements are implicit self-closing tags, <br> is equivalent to <br/>

      Note: Once the node hierarchy is fixed, VideoTrackCheck can be simplified to not look for descendant nodes but just children.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              alban.auzeill Alban Auzeill
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: