[Webkit-unassigned] [Bug 64072] New: [Meta] "Flattened tree" concept should be explicit in the code

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 7 01:13:03 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=64072

           Summary: [Meta] "Flattened tree" concept should be explicit in
                    the code
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: morrita at google.com
                CC: dglazkov at chromium.org


Working on Bug 63977, It became clear that we should have a way to beware "flattened tree" concept in XBL mean.

Here is a rough idea:
- At first, extract NodeFlattener from NodeRenderingContext.
- Then expand its usage to where we should care about flattened tree:
  - Focus handling,
  - Text iteration,
  - And possibly more!

NodeFlattener would look like this:
----
class NodeFlattener
{
public:
    Node* nextSibling() const;
    Node* previousSibling() const;
    Node* parent() const;
    Node* next() const; // dfs traversal like traverseNextNode()

    void moveToNextSibling();
    .... // more moveTo family will come here.
private:
    Node* m_node;
   ... // Pull a part of NodeRenderingContext state here.
};
----

NodeFlattener is like TreeWalker, but should be more lightweight.
- It doesn't have script binding.
- It's stack-based.
Ideally, it would be great if the flattener can be used as a smart pointer for the node.
But I think it isn't feasible because it has a many state
which makes a copy operation bit expensive.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list