Closed Bug 1151940 Opened 10 years ago Closed 10 years ago

Make various CSSOM-view attributes replaceable

Categories

(Core :: DOM: CSS Object Model, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(3 files)

See spec change at https://github.com/w3c/csswg-drafts/commit/6a4f24fe558bb3e76d77a499575ac81ba2a5c369 and W3C bug at https://www.w3.org/Bugs/Public/show_bug.cgi?id=24160 This would be all simple except some of them are readonly in the spec but writable in our impl, which will take a bit of work. I don't plan to change the behavior of the XPCOM bits here, since those aren't used from script anyway. Just going to change the WebIDL bits.
Comment on attachment 8589319 [details] [diff] [review] part 1. Make some readonly properties defined on Window by CSSOM-view replaceable > // client > //[Throws] readonly attribute double screenX; > //[Throws] readonly attribute double screenY; > //[Throws] readonly attribute double outerWidth; > //[Throws] readonly attribute double outerHeight; Why not mark also these Replacable
Attachment #8589319 - Flags: review?(bugs) → review+
> Why not mark also these Replacable Good point. Will do that in part 3 (for the commented-out spec versions).
Attachment #8589320 - Flags: review?(bugs) → review+
Comment on attachment 8589321 [details] [diff] [review] part 3. Make some writable cssom-view attributes that we only allow setting from chrome act the way readonly replaceables would when called from content > NS_IMETHODIMP > nsGlobalWindow::SetOuterWidth(int32_t aOuterWidth) > { >+ if (IsFrame()) { >+ return NS_OK; >+ } ... > nsGlobalWindow::SetOuterHeight(int32_t aOuterHeight) > { >+ if (IsFrame()) { >+ return NS_OK; >+ } ... > NS_IMETHODIMP > nsGlobalWindow::SetScreenX(int32_t aScreenX) > { >+ if (IsFrame()) { >+ return NS_OK; >+ } Ok, took some time to understand these changes, but should be safe. Technically a change to XPCOM bits, but fine. >@@ -200,24 +201,25 @@ partial interface Window { > //[Replaceable, Throws] readonly attribute double scrollY; > //[Replaceable, Throws] readonly attribute double pageYOffset; > [Replaceable, Throws] readonly attribute long scrollX; > [Replaceable, Throws] readonly attribute long pageXOffset; > [Replaceable, Throws] readonly attribute long scrollY; > [Replaceable, Throws] readonly attribute long pageYOffset; > > // client >+ // These are writable because we allow chrome to write them. > //[Throws] readonly attribute double screenX; > //[Throws] readonly attribute double screenY; > //[Throws] readonly attribute double outerWidth; > //[Throws] readonly attribute double outerHeight; >- [Throws] attribute long screenX; >- [Throws] attribute long screenY; >- [Throws] attribute long outerWidth; >- [Throws] attribute long outerHeight; >+ [Throws] attribute any screenX; >+ [Throws] attribute any screenY; >+ [Throws] attribute any outerWidth; >+ [Throws] attribute any outerHeight; I think use of 'any' is so odd here that a comment explaining it would be good.
Attachment #8589321 - Flags: review?(bugs) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: