-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set dirty value flag for setRangeText() #2435
Conversation
Content LGTM. Editorially this is strange; just reading the text it sounds weird because two different concepts are using the term "dirty value flag", so unless you hover over the links, the sentence just looks very wrong. I'm not sure if there's any good fix for that. Maybe "input dirty value flag" and "textarea dirty value flag"? |
I think the right fix would be to make it a shared concept, but I was lazy. As for tests, the issue mentions some that could be uplifted from Gecko. |
#setting-minimum-input-length-requirements:-the-minlength-attribute seems to use |
Absolutely. I can just create a wpt PR, or move them to the to-be-synced bits in Gecko's tests and wait for jgraham to uplift them, or whatever. Just let me know. |
@bzbarsky whatever is most expedient for you is fine. If you could leave some pointer here of that happening that should be sufficient for archeologists. |
I'll do this gecko-side, then. Minimal merge pain for me. Will land it once this PR is in. |
Okay, I think it's fine to land it now as long as the commit message includes a pointer here, but up to you. This PR is blocked on some feedback from @domenic. |
I do. Yesterday I thought that there was no good place to put the definition, but now I'm thinking the section "A form control's value" is a pretty good place for it. Maybe I'm forgetting some reason that made less sense yesterday. We can also do the |
50d7008
to
56c35cc
Compare
I tried to fix both here. Used distinct commits to separate editorial from normative change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need a better description of what it is, or leave the description out. Sorry this is dragging on a bit.
source
Outdated
@@ -49906,7 +49903,7 @@ interface <dfn>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> { | |||
|
|||
<p>The <dfn><code data-x="attr-textarea-maxlength">maxlength</code></dfn> attribute is a <span | |||
data-x="attr-fe-maxlength">form control <code data-x="">maxlength</code> attribute</span> controlled | |||
by the <code>textarea</code> element's <span data-x="concept-textarea-dirty">dirty value | |||
by the <code>textarea</code> element's <span data-x="concept-fe-dirty">dirty value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and below, I think the "controlled by the X element's dirty value flag" is now redundant. That's generically part of the definition of form control maxlength attribute now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up removing this four times.
source
Outdated
@@ -51118,6 +51115,10 @@ interface <dfn>HTMLLegendElement</dfn> : <span>HTMLElement</span> { | |||
email fields might translate that into a <span data-x="concept-fe-value">value</span> of "<code | |||
data-x="">[email protected]</code>" (without the leading whitespace).</p> | |||
|
|||
<p id="concept-input-value-dirty-flag"><span id="concept-textarea-dirty"></span><code>input</code> | |||
and <code>textarea</code> elements have a <dfn data-x="concept-fe-dirty">dirty value flag</dfn>. | |||
This is used to determine what to display to the user.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is an accurate description of how it's used. I would say it's used to determine the interaction between the DOM structure (value content attribute or text node children) and the form control's value. Not sure how to phrase "DOM structure" better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The simplest thing may be to say that it's used to determine the interaction between the default value and the value. If the flag is not set, the value tracks the default value. If it's set, the value is independent of the default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I contrasted value and the value content attribute since we don't really have a default value concept per se. I used data-x="" for the value content attribute since I didn't want to reiterate the input/textarea distinction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's great, because now the definition only applies to input elements. The "default value" concept does somewhat exist; the spec says
The contents of the control represent the control's default value.
for textarea and
The value content attribute gives the default value of the input element.
for input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it only apply to input elements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, doh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay.
56c35cc
to
cea1858
Compare
cea1858
to
0f20791
Compare
Apologies, pushed a new version that just says default value as it should. |
Fixes #2425.