Wicket
  1. Wicket
  2. WICKET-3820

New Chrome merges text in replaceOuterHtml, breaking wicket-ajax

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.17, 1.5-RC5.1
    • Fix Version/s: 1.4.18, 1.5-RC6
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Chrome 13.0.782.24

      Description

      Chrome 13.0.782.24 beta changes the way "element.outerHTML = text" is handled in a way that breaks Wicket's AJAX rendering compared to Chrome 12.0.782.100 (stable).

      Before the outerHTML assignment that replaces the DOM content, Wicket.replaceOuterHtmlSafari() grabs element.nextSibling. After the outerHTML assignment, it iterates through the new element siblings until the previous "next" is encountered. However, when the new text contains trailing whitespace, and the "previous next" is a text node, the new version of Chrome merges the two text nodes into a single text node, invalidating the iteration's termination condition. This eventually leads to a null reference, breaking subsequent Javascript/AJAX functionality.

      Is it a good idea to simply add "while (next.nodeType == 3) next = next.nextSibling;" after the next assignment in Wicket.replaceOuterHtmlSafari? This just makes the "previous next" reference something other than a text node.

      1. chromeajax.patch
        0.5 kB
        Dan Retzlaff
      2. chromeajax.zip
        9 kB
        Dan Retzlaff

        Issue Links

          Activity

          Hide
          Martin Grigorov added a comment -

          Since recently Chrome is treated as Gecko in replaceOuterHtml(), not as Safari, so this shouldn't be a problem in RC5.
          Can you test whether Safari fails with this problem ?

          Show
          Martin Grigorov added a comment - Since recently Chrome is treated as Gecko in replaceOuterHtml(), not as Safari, so this shouldn't be a problem in RC5. Can you test whether Safari fails with this problem ?
          Hide
          Igor Vaynberg added a comment -

          it bit me earlier today. this is something we will need to fix in 1.4.18

          Show
          Igor Vaynberg added a comment - it bit me earlier today. this is something we will need to fix in 1.4.18
          Hide
          Dan Retzlaff added a comment -

          It traces to this WebKit change: https://bugs.webkit.org/show_bug.cgi?id=52686

          I can test in Safari tomorrow, but I think it's only a matter of time until Safari upgrades its WebKit as well.

          Show
          Dan Retzlaff added a comment - It traces to this WebKit change: https://bugs.webkit.org/show_bug.cgi?id=52686 I can test in Safari tomorrow, but I think it's only a matter of time until Safari upgrades its WebKit as well.
          Hide
          Dan Retzlaff added a comment - - edited

          Safari 5.0.5 (current) has WebKit 533.21.1 and is OK.
          Chrome 12.x (stable) has WebKit 534.3 and is OK.
          Chrome 13.x (beta) has WebKit 535.1 and is broken.

          Since Chrome 12.x was released 2011-06-07, and they release to stable about every 6 weeks, we probably have about 4 weeks before the change hits Chrome stable.

          The Safari 5.1 developer preview uses WebKit 534.42 which does NOT contain the text-merge behavior, so Safari looks good for a while.

          Show
          Dan Retzlaff added a comment - - edited Safari 5.0.5 (current) has WebKit 533.21.1 and is OK. Chrome 12.x (stable) has WebKit 534.3 and is OK. Chrome 13.x (beta) has WebKit 535.1 and is broken. Since Chrome 12.x was released 2011-06-07, and they release to stable about every 6 weeks, we probably have about 4 weeks before the change hits Chrome stable. The Safari 5.1 developer preview uses WebKit 534.42 which does NOT contain the text-merge behavior, so Safari looks good for a while.
          Hide
          David Shepherdson added a comment -

          The release version of Safari 5.1 (on both Snow Leopard/10.6 and Lion/10.7) appears to include this text-merge change, meaning that Wicket's AJAX functionality breaks there too.

          We'll patch our local Wicket accordingly, but for everybody else, how far away is 1.4.18 from release?

          Show
          David Shepherdson added a comment - The release version of Safari 5.1 (on both Snow Leopard/10.6 and Lion/10.7) appears to include this text-merge change, meaning that Wicket's AJAX functionality breaks there too. We'll patch our local Wicket accordingly, but for everybody else, how far away is 1.4.18 from release?

            People

            • Assignee:
              Martin Grigorov
              Reporter:
              Dan Retzlaff
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development