New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make offset parent queries less buggy. #14839
Merged
+364
−74
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
014ad76
Added assertion to process_offset_parent_query
Permutatrix 0a5218d
Fixed ParentOffsetBorderBoxIterator's keeping track of parents
Permutatrix 6623583
offsetParent queries now basically work on inline nodes.
Permutatrix 18793af
Don't crash when offset parent querying an element not in the document
Permutatrix a61a263
Added tests/wpt/web-platform-tests/cssom-view/offsetPropertiesInline.…
Permutatrix 6a76525
Replaced trivial pattern matching with is_none() and is_some()
Permutatrix fa0cb7c
Assert self.node_offset_box is None if fragment.node == self.node_add…
Permutatrix 699fc4b
Use InlineFragmentNodeFlags in ParentOffsetBorderBoxIterator
Permutatrix 923ecba
Updated expectations for passing tests
Permutatrix db5da15
Updated expectations for failing tests that were passing erroneously
Permutatrix 4825169
Split 123-character line
Permutatrix defa7d9
Actually, node_position probably won't be needed later.
Permutatrix b75dcc0
Made assertions more helpful
Permutatrix 5be1879
"above the root node" -> "below the root node"
Permutatrix 290ebab
Moved and adjusted offset_properties_inline test
Permutatrix 5ef7a0a
Don't store the offset parent's dimensions
Permutatrix 686d2f8
Don't use rposition() and unwrap() to find parent info
Permutatrix 74e34d6
Handle hypothetical fragments
Permutatrix cb0d43a
Broke up some comment lines that were a bit too long
Permutatrix af633b2
Use parent padding box, not border box
Permutatrix 2cd5384
Don't take measurements from non-primary fragments
Permutatrix 400a267
/css-text-3_dev/html/word-break-normal-zh-000.htm fails on Mac
Permutatrix File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
Added tests/wpt/web-platform-tests/cssom-view/offsetPropertiesInline.…
…html
- Loading branch information
Permutatrix
committed
Jan 13, 2017
Permutatrix
Permutator
commit a61a263291bae9587d8e4395f531e0149a042f7a
Verified
This commit was signed with a verified signature.
GPG key ID: 62D7A8D792C3B058
Learn about signing commits
| "path": "cssom-view/negativeMargins.html", | ||
| "url": "/cssom-view/negativeMargins.html" | ||
| }, | ||
| { | ||
| "path": "cssom-view/offsetPropertiesInline.html", | ||
| "url": "/cssom-view/offsetPropertiesInline.html" | ||
| }, | ||
| { | ||
| "path": "cssom-view/scrolling-no-browsing-context.html", | ||
| "url": "/cssom-view/scrolling-no-browsing-context.html" |
| @@ -0,0 +1,80 @@ | ||
| <!DOCTYPE html> | ||
| <meta charset=utf-8> | ||
| <title>cssom-view - offsetParent, offsetTop, offsetLeft, offsetWidth, and offsetHeight on inline elements</title> | ||
| <script src="/resources/testharness.js"></script> | ||
| <script src="/resources/testharnessreport.js"></script> | ||
| <style> | ||
| #real-offset-parent { | ||
| font: 10px/1 Ahem; | ||
| margin: 0; | ||
| border: none; | ||
| padding: 0; | ||
| } | ||
| #real-offset-parent, #decoy-offset-parent { | ||
| position: relative; | ||
| } | ||
| </style> | ||
| <body> | ||
| <div id="real-offset-parent"> | ||
| <span id="inline-1">ABC</span> | ||
| <span id="inline-2">ABC<br />ABC</span> | ||
| <span id="inline-3">ABC</span> | ||
| </div> | ||
| <div id="decoy-offset-parent"></div> | ||
|
||
| <script> | ||
| setup({ explicit_done: true }); | ||
emilio
Member
|
||
| window.onload = function() { | ||
| var realOffsetParent = document.getElementById('real-offset-parent'); | ||
| var inline1 = document.getElementById('inline-1'); | ||
| var inline2 = document.getElementById('inline-2'); | ||
| var inline3 = document.getElementById('inline-3'); | ||
|
|
||
| test(function() { | ||
| assert_equals(inline1.offsetParent, realOffsetParent, | ||
| "offsetParent of #inline-1 should be #real-offset-parent."); | ||
| assert_equals(inline2.offsetParent, realOffsetParent, | ||
| "offsetParent of #inline-2 should be #real-offset-parent."); | ||
| assert_equals(inline3.offsetParent, realOffsetParent, | ||
| "offsetParent of #inline-3 should be #real-offset-parent."); | ||
| }, "offsetParent"); | ||
|
|
||
| test(function() { | ||
| assert_equals(inline1.offsetTop, 0, | ||
| "offsetTop of #inline-1 should be 0."); | ||
| assert_equals(inline2.offsetTop, 0, | ||
| "offsetTop of #inline-2 should be 0."); | ||
| assert_equals(inline3.offsetTop, 10, | ||
| "offsetTop of #inline-3 should be 10."); | ||
| }, "offsetTop"); | ||
|
|
||
| test(function() { | ||
| assert_equals(inline1.offsetLeft, 0, | ||
| "offsetLeft of #inline-1 should be 0."); | ||
| assert_equals(inline2.offsetLeft, 40, | ||
| "offsetLeft of #inline-2 should be 40."); | ||
| assert_equals(inline3.offsetLeft, 40, | ||
| "offsetLeft of #inline-3 should be 40."); | ||
| }, "offsetLeft"); | ||
|
|
||
| test(function() { | ||
| assert_equals(inline1.offsetWidth, 30, | ||
| "offsetWidth of #inline-1 should be 30."); | ||
| assert_equals(inline2.offsetWidth, 70, | ||
| "offsetWidth of #inline-2 should be 70."); | ||
| assert_equals(inline3.offsetWidth, 30, | ||
| "offsetWidth of #inline-3 should be 30."); | ||
| }, "offsetWidth"); | ||
|
|
||
| test(function() { | ||
| assert_equals(inline1.offsetHeight, 10, | ||
| "offsetHeight of #inline-1 should be 10."); | ||
| assert_equals(inline2.offsetHeight, 20, | ||
| "offsetHeight of #inline-2 should be 20."); | ||
| assert_equals(inline3.offsetHeight, 10, | ||
| "offsetHeight of #inline-3 should be 10."); | ||
| }, "offsetHeight"); | ||
|
|
||
| done(); | ||
| }; | ||
| </script> | ||
| </body> | ||
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Is
decoy-offset-parenthere for some reason? Seems unused. If so, add a comment about it.Also, don't put this test in the
web-platform-testsdirectory directly (see #12326). Put it undertests/mozilla/css.