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

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24936 Thu Jun 30 16:33:18 MDT 2011 ted.goddard integration of ancestor pruning with DOM diff. Insert/Delete code is provided but not activated due to mojarra bug (ICE-7000)
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/application.js
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/util/DOMUtils.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/context/DOMPartialViewContext.java
        Ted Goddard created issue -
        Ted Goddard made changes -
        Field Original Value New Value
        Assignee Ted Goddard [ ted.goddard ]
        Ted Goddard made changes -
        Salesforce Case []
        Fix Version/s 2.1 [ 10241 ]
        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.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24939 Fri Jul 01 08:22:39 MDT 2011 ted.goddard modified test to adapt to EditOperation API (ICE-7000)
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/test/java/org/icefaces/domDiff/DomDiffTest.java
        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.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24944 Mon Jul 04 09:22:41 MDT 2011 ted.goddard log failure case of diff propagating to root with no ID (ICE-7000)
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/util/DOMUtils.java
        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).
        Mark Collette made changes -
        Link This issue blocks ICE-7034 [ ICE-7034 ]
        Ken Fyten made changes -
        Fix Version/s 3.1 [ 10312 ]
        Fix Version/s 3.0 [ 10241 ]
        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.
        Ted Goddard made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.0 [ 10241 ]
        Fix Version/s 3.1 [ 10312 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: