ICEfaces
  1. ICEfaces
  2. ICE-7000

DOM diff algorithm improvements

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 3.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces

      Description


      The DOM diff algorithm can benefit from integrated "ancestor pruning" and incorporation of insert and delete features.

        Activity

        Hide
        Ted Goddard added a comment -

        Integrated ancestor pruning can be tested with assertions enabled as a JVM flag or :

        -ea:org.icefaces...

        export CATALINA_OPTS="-ea:org.icefaces..."

        Show
        Ted Goddard added a comment - Integrated ancestor pruning can be tested with assertions enabled as a JVM flag or : -ea:org.icefaces... export CATALINA_OPTS="-ea:org.icefaces..."
        Hide
        Ted Goddard added a comment -

        Insert/Delete will be conditionally enabled by components once jsf-impl is updated to include fixes for HTML table insertion.

        Show
        Ted Goddard added a comment - Insert/Delete will be conditionally enabled by components once jsf-impl is updated to include fixes for HTML table insertion.
        Hide
        Ted Goddard added a comment -

        Includes ideas from work by Mark and Greg in ICE-6591 and ICE-6565.

        Show
        Ted Goddard added a comment - Includes ideas from work by Mark and Greg in ICE-6591 and ICE-6565.
        Hide
        Ted Goddard added a comment -

        in core:

        ant -f test.xml

        [junit] Running org.icefaces.domDiff.DomDiffTest
        [junit] Tests run: 12, Failures: 0, Errors: 0, Time elapsed: 0.465 sec

        Show
        Ted Goddard added a comment - in core: ant -f test.xml [junit] Running org.icefaces.domDiff.DomDiffTest [junit] Tests run: 12, Failures: 0, Errors: 0, Time elapsed: 0.465 sec
        Hide
        Mark Collette added a comment -

        Have we covered the base case, where something near the top of the dom tree causes a diff of the Document? If at the top level an Element causes a return false from compareNodes, then there's no code to catch that and return the whole Document.

        Show
        Mark Collette added a comment - Have we covered the base case, where something near the top of the dom tree causes a diff of the Document? If at the top level an Element causes a return false from compareNodes , then there's no code to catch that and return the whole Document.
        Hide
        Ted Goddard added a comment -

        Good point; the top level return value of compareNodes() should not have been ignored. This case is now being logged at severe level: "Diff propagated to root but no ID set". If the top level nodes have IDs, then they will generate the needed ReplaceOperation. If they do not have IDs, then nothing can be done and the condition is logged (proceeding with the other edit operations otherwise obtained). Note that <html> and <body> will typically have IDs due to code in DOMPartialViewContext. In the case of a subtree diff, an ID will typically be present since the component has specified the subtree render by ID (however it is possible that a component bug would produce a case where the ID was missing).

        Show
        Ted Goddard added a comment - Good point; the top level return value of compareNodes() should not have been ignored. This case is now being logged at severe level: "Diff propagated to root but no ID set". If the top level nodes have IDs, then they will generate the needed ReplaceOperation. If they do not have IDs, then nothing can be done and the condition is logged (proceeding with the other edit operations otherwise obtained). Note that <html> and <body> will typically have IDs due to code in DOMPartialViewContext. In the case of a subtree diff, an ID will typically be present since the component has specified the subtree render by ID (however it is possible that a component bug would produce a case where the ID was missing).
        Hide
        Ted Goddard added a comment -

        Pruning is now integrated with the DOM diff recursion.

        Show
        Ted Goddard added a comment - Pruning is now integrated with the DOM diff recursion.

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: