Shindig
  1. Shindig
  2. SHINDIG-1745

adjustHeight fails on Chrome 11 when using explicit height on top-level dom element

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.5.0-beta2
    • Component/s: Javascript
    • Labels:
    • Environment:
      Chrome 11 (Webkit)

      Description

      Given a gadget structured like the following snippet, gadgets.window.adjustHeight() does not call the container to change the height of the iframe:

      <body>
      <div id="content" style="height:500px">...</div>
      </body>

        Activity

        Hide
        Ed Venagila added a comment -

        Since adjustHeight() is called without an arg, the hight computation is triggered. This delegates to getHeightForWebkit(), which returns 0. A later check aborts the RPC call to the container.

        getHeightForWebkit() properly detects the height property, either directly from the style, or if this height is attributed by css. It then skips any further calculation, without updating the local var result.

        In keeping with the logic used in walking though child elements, that computes the maximal bottom edge, I propose setting the initial value to the document.body.offsetHeight, rather than 0.

        Patch file is attached

        Show
        Ed Venagila added a comment - Since adjustHeight() is called without an arg, the hight computation is triggered. This delegates to getHeightForWebkit(), which returns 0. A later check aborts the RPC call to the container. getHeightForWebkit() properly detects the height property, either directly from the style, or if this height is attributed by css. It then skips any further calculation, without updating the local var result. In keeping with the logic used in walking though child elements, that computes the maximal bottom edge, I propose setting the initial value to the document.body.offsetHeight, rather than 0. Patch file is attached
        Hide
        Henry Saputra added a comment -

        +1

        Show
        Henry Saputra added a comment - +1
        Hide
        Henry Saputra added a comment -

        Ed, should this be clientHeight instead of offsetHeight bc the end of function its trying to add the border-bottom and padding-bottom?

        Show
        Henry Saputra added a comment - Ed, should this be clientHeight instead of offsetHeight bc the end of function its trying to add the border-bottom and padding-bottom?
        Hide
        Dan Dumont added a comment - - edited

        @Ed

        Can you try out the latest shindig with this patch: https://reviews.apache.org/r/5067/
        Your problem may be addressed with these changes.

        Show
        Dan Dumont added a comment - - edited @Ed Can you try out the latest shindig with this patch: https://reviews.apache.org/r/5067/ Your problem may be addressed with these changes.
        Hide
        Dan Dumont added a comment -
        Show
        Dan Dumont added a comment - Indirectly fixed by https://issues.apache.org/jira/browse/SHINDIG-1767

          People

          • Assignee:
            Dan Dumont
            Reporter:
            Ed Venagila
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development