Last Comment Bug 768744 - GCLI places input elements incorrectly if element ancestory has a 'fixed' or 'absolute'
: GCLI places input elements incorrectly if element ancestory has a 'fixed' or ...
Status: RESOLVED FIXED
[fixed-in-fx-team]
:
Product: Firefox
Classification: Client Software
Component: Developer Tools: Console (show other bugs)
: unspecified
: All All
: -- major (vote)
: Firefox 18
Assigned To: Joe Walker [:jwalker] (needinfo me or ping on irc)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-26 18:43 PDT by Grant Gayed
Modified: 2012-09-06 01:09 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (1.09 KB, patch)
2012-06-26 18:43 PDT, Grant Gayed
jwalker: review+
Details | Diff | Review
v2 (1.34 KB, patch)
2012-08-26 03:22 PDT, Joe Walker [:jwalker] (needinfo me or ping on irc)
no flags Details | Diff | Review
v3 (1.35 KB, patch)
2012-08-29 02:48 PDT, Joe Walker [:jwalker] (needinfo me or ping on irc)
no flags Details | Diff | Review

Description Grant Gayed 2012-06-26 18:43:55 PDT
Created attachment 636970 [details] [diff] [review]
patch

- this affects Orion's use of GCLI because Orion's use of dojo creates elements that currently throw off the positioning of GCLI's input elements

Steps:
- start with the example index.html from GCLI's root dir
- put its "gcli-display" and "gcli-input" elements into a div, so that they now look like:

<div style="position:absolute;top:100px;width:100%;height:70%;">
  <div id="gcli-display"></div>
  <input id="gcli-input" type="text" autofocus/>
</div>

- view the page
- the GCLI-created input elements are placed incorrectly because their absolute positions are computed in Inputter.prototype.getDimensions() relative to the document origin, but if there's a 'fixed' or 'absolute' ancestor then at render time this position will be considered to be relative to that element, not to the document origin

- patch that demonstrates a possible fix is attached
Comment 1 Joe Walker [:jwalker] (needinfo me or ping on irc) 2012-08-26 03:22:05 PDT
This code should not affect firefox, but does alter gcli.jsm so we need to check that there is no breakage.
Comment 2 Joe Walker [:jwalker] (needinfo me or ping on irc) 2012-08-26 03:22:52 PDT
Created attachment 655412 [details] [diff] [review]
v2

Updates for gcli.jsm
Comment 3 Joe Walker [:jwalker] (needinfo me or ping on irc) 2012-08-29 02:48:13 PDT
Created attachment 656380 [details] [diff] [review]
v3

Minor fix. We need to ensure that we're using the correct document. This is important both for when gcli is in an iframe, and for when it's embedded in a xul document.
Comment 4 Joe Walker [:jwalker] (needinfo me or ping on irc) 2012-08-29 02:48:23 PDT
https://tbpl.mozilla.org/?tree=Try&rev=95edd1e1af78
Comment 5 Joe Walker [:jwalker] (needinfo me or ping on irc) 2012-08-29 02:51:54 PDT
https://tbpl.mozilla.org/?tree=Fx-Team&rev=3636c402ea3d
Comment 6 Victor Porof [:vporof][:vp] 2012-08-30 11:50:01 PDT
https://hg.mozilla.org/mozilla-central/rev/3636c402ea3d

Note You need to log in before you can comment on or make changes to this bug.