Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the details, picture and marquee elements
The marquee element is mostly a stub, and the actual picture selection logic is not implemented either. But this at least gives them all the right element interface, and for details is a full implementation.
- Loading branch information
Showing
8 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"use strict"; | ||
|
||
const Event = require("../generated/Event.js"); | ||
|
||
const HTMLElementImpl = require("./HTMLElement-impl").implementation; | ||
|
||
class HTMLDetailsElementImpl extends HTMLElementImpl { | ||
constructor(args, privateData) { | ||
super(args, privateData); | ||
|
||
this._taskQueue = null; | ||
} | ||
|
||
_dispatchToggleEvent() { | ||
this._taskQueue = null; | ||
|
||
this._dispatch( | ||
Event.createImpl(["toggle", { | ||
bubbles: false, cancelable: false | ||
}], { isTrusted: true }) | ||
); | ||
} | ||
|
||
_attrModified(name, value, oldValue) { | ||
super._attrModified(name, value, oldValue); | ||
|
||
if (name === "open" && this._taskQueue === null) { | ||
// Check that the attribute is added or removed, not merely changed | ||
if (value !== oldValue && | ||
value !== null && oldValue === null || | ||
value === null && oldValue !== null) { | ||
this._taskQueue = setTimeout(this._dispatchToggleEvent.bind(this), 0); | ||
} | ||
} | ||
} | ||
} | ||
|
||
module.exports = { | ||
implementation: HTMLDetailsElementImpl | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[Exposed=Window, | ||
HTMLConstructor] | ||
interface HTMLDetailsElement : HTMLElement { | ||
[CEReactions, Reflect] attribute boolean open; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use strict"; | ||
|
||
const HTMLElementImpl = require("./HTMLElement-impl").implementation; | ||
|
||
class HTMLMarqueeElementImpl extends HTMLElementImpl { } | ||
|
||
module.exports = { | ||
implementation: HTMLMarqueeElementImpl | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[Exposed=Window, | ||
HTMLConstructor] | ||
interface HTMLMarqueeElement : HTMLElement { | ||
[CEReactions, Reflect] attribute DOMString behavior; | ||
[CEReactions, Reflect=bgcolor] attribute DOMString bgColor; | ||
[CEReactions, Reflect] attribute DOMString direction; | ||
[CEReactions, Reflect] attribute DOMString height; | ||
[CEReactions, Reflect] attribute unsigned long hspace; | ||
// [CEReactions] attribute long loop; | ||
[CEReactions, Reflect=scrollamount] attribute unsigned long scrollAmount; | ||
[CEReactions, Reflect=scrolldelay] attribute unsigned long scrollDelay; | ||
[CEReactions, Reflect=truespeed] attribute boolean trueSpeed; | ||
[CEReactions, Reflect] attribute unsigned long vspace; | ||
[CEReactions, Reflect] attribute DOMString width; | ||
|
||
// attribute EventHandler onbounce; | ||
// attribute EventHandler onfinish; | ||
// attribute EventHandler onstart; | ||
|
||
// void start(); | ||
// void stop(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use strict"; | ||
|
||
const HTMLElementImpl = require("./HTMLElement-impl").implementation; | ||
|
||
class HTMLPictureElementImpl extends HTMLElementImpl { } | ||
|
||
module.exports = { | ||
implementation: HTMLPictureElementImpl | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[Exposed=Window, | ||
HTMLConstructor] | ||
interface HTMLPictureElement : HTMLElement {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters