Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add prose regarding SyntaxError
  • Loading branch information
Naina Raisinghani committed Apr 4, 2016
commit c06ae22227fb215fa1147dbbce00e40615bf667c
18 changes: 9 additions & 9 deletions css-typed-om/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ dictionary CalcDictionary {
};

interface LengthValue : StyleValue {
LengthValue add(LengthValue value); // can throw
LengthValue subtract(LengthValue value); // can throw
LengthValue multiply(double value); // can throw
LengthValue divide(double value); // can throw
static LengthValue parse(DOMString cssText);
static LengthValue fromValue(double value, LengthType type);
static LengthValue fromDictionary(CalcDictionary dictionary);
LengthValue add(LengthValue value); // can throw SyntaxError
LengthValue subtract(LengthValue value); // can throw SyntaxError
LengthValue multiply(double value); // can throw SyntaxError
LengthValue divide(double value); // can throw SyntaxError
static LengthValue parse(DOMString cssText); // can throw SyntaxError
static LengthValue fromValue(double value, LengthType type); // can throw SyntaxError
static LengthValue fromDictionary(CalcDictionary dictionary); // can throw SyntaxError
};

[Constructor(DOMString cssText),
Expand Down Expand Up @@ -336,6 +336,8 @@ interface SimpleLength : LengthValue {
};
</pre>

If the provided DOMString or {{LengthValue}} is invalid the relevant function throws a SyntaxError.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to describe why each method can throw.

e.g. add, etc. throw if called on or passed a LengthValue that isn't a SimpleLength or CalcLength.
parse throws if the DOMString isn't a valid representation of a length.
I don't think fromValue, fromDictionary can throw.


Issue(165): do we want an enum of length keywords too?

Issue(167): write long descriptions of all of this
Expand All @@ -344,8 +346,6 @@ Issue(168): There are now 3 ways of creating Length values -
StyleValue.parse, CalcLength/SimpleLength constructors, and LengthValue.parse / fromValue / fromDictionary.
Is this too much?

Issue(166): What happens if the provided DOMString or LengthValue for (e.g.) a SimpleLength is invalid?

{{TransformValue}} objects {#transformvalue-objects}
-----------------------------------------------------------

Expand Down