#6809 closed enhancement (fixed)
Add jQuery.support.fixedPosition
Reported by: | scottgonzalez | Owned by: | Rick Waldron |
---|---|---|---|
Priority: | blocker | Milestone: | 1.7 |
Component: | support | Version: | 1.4.2 |
Keywords: | 1.7-discuss | Cc: | |
Blocked by: | Blocking: |
Description
jQuery already detects support for fixed positioning in the offset code. jQuery.offset.supportsFixedPosition should be moved to jQuery.support.fixedPosition and calculated immediately.
Change History (27)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Milestone: | 1.4.3 → 1.5 |
---|---|
Priority: | → low |
comment:3 Changed 13 years ago by
Status: | new → open |
---|
comment:4 Changed 13 years ago by
I think that other properties should live in jQuery.offset, just because they're internal and used only in offset.js. I have just forked jquery on github and pushed changed to my master-branch. Also created pull-request for this change.
comment:5 Changed 13 years ago by
I'm not sure about this particular patch (no offense) but I definitely think this should be reviewed further.
comment:6 Changed 12 years ago by
Here is the relevant jQuery.offset.supportsFixedPosition
code fwiw:
https://github.com/jquery/jquery/blob/eed380/src/offset.js#L125-143
It should certainly execute lazily, but augmenting jQuery.support
proper makes sense to me.
comment:8 Changed 12 years ago by
comment:11 Changed 12 years ago by
+1, There is no reason why offset should keep a private repository of support properties... ajax does its own support tests yet publishes the result on the main support object.
comment:14 Changed 12 years ago by
+1,
though.. iOS false positives on nearly all written fixed pos tests (incl this one); https://github.com/Modernizr/Modernizr/issues/167
Might be unsolvable and leave it up to docs to explain
comment:15 Changed 12 years ago by
+1, If some code can benefit from precomputing it, rather than on-demand, fine.
comment:19 Changed 12 years ago by
Milestone: | 1.next → 1.7 |
---|---|
Priority: | low → blocker |
comment:21 Changed 12 years ago by
Owner: | set to Rick Waldron |
---|---|
Status: | open → assigned |
comment:22 Changed 12 years ago by
The problem I'm initially running into is that support is generally run before before the real body
actually exists... I think I can work around that, draft implementation to follow.
comment:23 Changed 12 years ago by
Working draft: https://github.com/rwldrn/jquery/tree/6809
Currently the only failing tests are:
offset: body (2, 0, 2)
comment:24 Changed 12 years ago by
Isn't this the case where you can do:
body = document.createElement("body");
to get the body element, even if it doesn't exist yet?
comment:25 Changed 12 years ago by
Yes - I'm using document.body if it happens to exist early enough or the fake body that the support module has already created as a backup
@ https://github.com/rwldrn/jquery/commit/1f1990431a9abb8e964825e5bf7bd7c1eb28fa1b
comment:26 Changed 12 years ago by
This works: http://mnobeta.no/2011/09/test-position-fixed-for-iphone/ On iphone. Android needs to be taken care of.
comment:27 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Landing pull request 477. 1.7 jQuery.offset.supportsFixedPosition. Fixes #6809.
More Details:
Would it make sense to move the others such as doesNotAddBorder as well?