https://bugzilla.wikimedia.org/show_bug.cgi?id=55871

       Web browser: ---
            Bug ID: 55871
           Summary: VisualEditor: Clean up constructor params to dm.Node
                    subclasses
           Product: VisualEditor
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Technical Debt
          Assignee: roan.katt...@gmail.com
          Reporter: roan.katt...@gmail.com
                CC: jforres...@wikimedia.org, krinklem...@gmail.com,
                    roan.katt...@gmail.com, tpars...@wikimedia.org
    Classification: Unclassified
   Mobile Platform: ---

* dm.LeafNode has (length, element), where length is ignored and forced to 0 by
all subclasses except for dm.TextNode
* dm.BranchNode has (children, element), length is computed while children are
added

The code in dm.Document constructing node trees needs to be aware of this, but
at the same time it doesn't even use these parameters, because branch nodes are
created as childless nodes that have their children added later, and text nodes
are created with length zero and have the correct length set later. So we
should just get rid of these parameters and make the constructors take a single
element parameter, that would get them in line with other dm.Model subclasses
(dm.Annotation and dm.MetaItem) as well.

While we're at it, we should also fix the documentation that claims that the
element parameter is optional, it really isn't.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to