Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#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 dmethvin

Would it make sense to move the others such as doesNotAddBorder as well?

comment:2 Changed 13 years ago by Rick Waldron

Milestone: 1.4.31.5
Priority: low

comment:3 Changed 13 years ago by snover

Status: newopen

comment:4 Changed 13 years ago by borisov.gleb@…

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 Rick Waldron

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 paul.irish

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:7 Changed 12 years ago by john

Milestone: 1.next

Let's look at this for 1.7.

comment:9 Changed 12 years ago by john

Keywords: 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:10 Changed 12 years ago by Rick Waldron

+1,

comment:11 Changed 12 years ago by jaubourg

+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:12 Changed 12 years ago by ajpiano

+1,

comment:13 Changed 12 years ago by Timmy Willison

+1, Makes sense.

comment:14 Changed 12 years ago by paul.irish

+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 dmethvin

+1, If some code can benefit from precomputing it, rather than on-demand, fine.

comment:16 Changed 12 years ago by john

+1, Seems easy enough.

comment:17 Changed 12 years ago by scottgonzalez

+1

comment:18 Changed 12 years ago by jzaefferer

+1

comment:19 Changed 12 years ago by dmethvin

Milestone: 1.next1.7
Priority: lowblocker

comment:20 Changed 12 years ago by iMarc

(comment deleted)

Last edited 12 years ago by iMarc (previous) (diff)

comment:21 Changed 12 years ago by john

Owner: set to Rick Waldron
Status: openassigned

comment:22 Changed 12 years ago by Rick Waldron

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 Rick Waldron

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 john

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 Rick Waldron

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

Last edited 12 years ago by Rick Waldron (previous) (diff)

comment:26 Changed 12 years ago by anonymous

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 Rick Waldron

Resolution: fixed
Status: assignedclosed

Landing pull request 477. 1.7 jQuery.offset.supportsFixedPosition. Fixes #6809.

More Details:

Note: See TracTickets for help on using tickets.