Closed
Bug 1151940
Opened 10 years ago
Closed 10 years ago
Make various CSSOM-view attributes replaceable
Categories
(Core :: DOM: CSS Object Model, defect)
Tracking
()
RESOLVED
FIXED
mozilla40
| Tracking | Status | |
|---|---|---|
| firefox40 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Details
Attachments
(3 files)
|
4.36 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
|
4.40 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
|
22.67 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
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.
| Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8589319 -
Flags: review?(bugs)
| Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8589320 -
Flags: review?(bugs)
| Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8589321 -
Flags: review?(bugs)
Comment 4•10 years ago
|
||
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+
| Assignee | ||
Comment 5•10 years ago
|
||
> Why not mark also these Replacable
Good point. Will do that in part 3 (for the commented-out spec versions).
Updated•10 years ago
|
Attachment #8589320 -
Flags: review?(bugs) → review+
Comment 6•10 years ago
|
||
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+
| Assignee | ||
Comment 7•10 years ago
|
||
Comment 8•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3044755948fd
https://hg.mozilla.org/mozilla-central/rev/ab636388d337
https://hg.mozilla.org/mozilla-central/rev/7a3a671dedd5
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in
before you can comment on or make changes to this bug.
Description
•