Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Issue 18060010: Added offset document measurement to Element. (Closed)

Created:
7 years, 5 months ago by Emily Fortuna
Modified:
7 years, 4 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Added offset document measurement to Element. BUG= R=jmesserly@google.com Committed: https://code.google.com/p/dart/source/detail?r=25483

Patch Set 1 #

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Total comments: 14

Patch Set 4 : #

Total comments: 2

Patch Set 5 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -2 lines) Patch
M sdk/lib/html/dart2js/html_dart2js.dart View 1 chunk +40 lines, -0 lines 0 comments Download
M sdk/lib/html/dartium/html_dartium.dart View 1 chunk +40 lines, -0 lines 0 comments Download
M tests/html/element_test.dart View 1 2 3 4 3 chunks +131 lines, -2 lines 0 comments Download
M tools/dom/templates/html/impl/impl_Element.darttemplate View 1 2 3 4 1 chunk +40 lines, -0 lines 2 comments Download

Messages

Total messages: 8 (0 generated)
Emily Fortuna
Baby steps
7 years, 5 months ago (2013-07-12 22:22:22 UTC) #1
blois
https://codereview.chromium.org/18060010/diff/3001/sdk/lib/html/dart2js/html_dart2js.dart File sdk/lib/html/dart2js/html_dart2js.dart (right): https://codereview.chromium.org/18060010/diff/3001/sdk/lib/html/dart2js/html_dart2js.dart#newcode8679 sdk/lib/html/dart2js/html_dart2js.dart:8679: Point get documentOffset() { Seems like it would be ...
7 years, 5 months ago (2013-07-12 23:10:08 UTC) #2
Emily Fortuna
now with ranges for browser variations!
7 years, 5 months ago (2013-07-24 23:11:32 UTC) #3
Jennifer Messerly
https://codereview.chromium.org/18060010/diff/13001/tests/html/element_test.dart File tests/html/element_test.dart (right): https://codereview.chromium.org/18060010/diff/13001/tests/html/element_test.dart#newcode78 tests/html/element_test.dart:78: expect(element.documentOffset.x, 9); slightly confused, should this be "documentOffset" or ...
7 years, 5 months ago (2013-07-24 23:26:23 UTC) #4
Emily Fortuna
PTAL https://codereview.chromium.org/18060010/diff/13001/tests/html/element_test.dart File tests/html/element_test.dart (right): https://codereview.chromium.org/18060010/diff/13001/tests/html/element_test.dart#newcode78 tests/html/element_test.dart:78: expect(element.documentOffset.x, 9); On 2013/07/24 23:26:23, John Messerly wrote: ...
7 years, 5 months ago (2013-07-25 00:20:07 UTC) #5
Jennifer Messerly
couple comments, other than that LGTM! https://codereview.chromium.org/18060010/diff/20001/tests/html/element_test.dart File tests/html/element_test.dart (right): https://codereview.chromium.org/18060010/diff/20001/tests/html/element_test.dart#newcode733 tests/html/element_test.dart:733: <ul class="level-1"> Parse ...
7 years, 5 months ago (2013-07-25 02:22:09 UTC) #6
Emily Fortuna
Committed patchset #5 manually as r25483 (presubmit successful).
7 years, 5 months ago (2013-07-25 17:45:47 UTC) #7
blois
7 years, 4 months ago (2013-07-27 00:00:56 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/18060010/diff/26001/tools/dom/templates/html/...
File tools/dom/templates/html/impl/impl_Element.darttemplate (right):

https://codereview.chromium.org/18060010/diff/26001/tools/dom/templates/html/...
tools/dom/templates/html/impl/impl_Element.darttemplate:1101: Point get
documentOffset => offsetTo(document.documentElement);
What's the difference between rolling the offsets up the offsetParent chain and
using getBoundingClientRect?

Looks like jQuery's offset() uses getBoundingClientRect.

https://codereview.chromium.org/18060010/diff/26001/tools/dom/templates/html/...
tools/dom/templates/html/impl/impl_Element.darttemplate:1115: return
Element._offsetToHelper(this, parent);
Why not just:

return new Point(documentOffset.x - other.documentOffset.x, documentOffset.y -
other.documentOffset.y)?

Then it can work on any elements, and not just parents. Also avoids the oddity
of requiring offset parents.

Powered by Google App Engine
This is Rietveld 408576698