Issue metadata
Sign in to add a comment
|
CSSStyleDeclaration return inconsistent value
Reported by
lingta...@gmail.com,
Oct 9 2016
|
||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0 Steps to reproduce the problem: 1. Open this page: http://codepen.io/lingtalfi/pen/dpmOPp 2. Open the dev tools console 3. Notice the last log line: 194.625px 4. Open the CSSStyleDeclaration object on the previous log line, and search for width: you will see 144px 5. Measure the button, which is effectively 144px 6. Conclude that you cannot access the 144px value, which is the correct one What is the expected behavior? btn1.clientWidth should be 144 (not 195) btn1.offsetWidth should be 144 (not 195) The value displayed (rendered?) via CSSStyleDeclaration.width should be accessible via window.getComputedStyle(btn1).width What went wrong? Did this work before? N/A Does this work in other browsers? N/A Chrome version: 55 Channel: n/a OS Version: OS X 10.11 Flash Version: Shockwave Flash 23.0 r0 I've found a workaround: wrap all the code in a setTimeout function with a delay of 100 (a delay of 10 is not sufficient, but that might depend on the complexity of the app?).
,
Oct 9 2016
If it was not possible to fix it, maybe could it be possible to have some kind of Event to listen to when the computations are ready?
window.addEventListener("computationReady", fn);
That would be better than a dirty setTimeout.
I tried with load, but didn't work.
,
Oct 10 2016
Seems to be this issue is similar to 652626. Hence merging this issue with 652626. Please undup if this is not similar issue. |
|||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||
Comment 1 by lingta...@gmail.com
, Oct 9 2016