-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
html5 method eating attribute value when value is eq to name #777
Comments
@wolfgangmm... just before it disappears on page 2, can it be confirmed as a bug ? |
Well, I guess the HTML5 serialiser needs a list of attributes which can be empty (e.g. "disabled") and should thus be collapsed. All other attributes should be preserved. I have not found such a list yet though. |
According to the HTML5 spec on boolean attributes (see also the WHATWG version), My question is: what is responsible for issuing the error, "Specification mandate value for attribute test"? Is it the browser (if so, which?) or some script running in the page (if so, is there an HTML5-compatible version?)? |
@joewiz Agreed (and thanks for the refs), but in this specific case, There are 2 problems here :
<form action="submit.xql">
Name: <input type="text" name="name"><br>
<input type="submit" value="Submit">
</form> parsed as (without value <form action="submit.xql">
Name: <input type="text" name><br>
<input type="submit" value="Submit">
</form>
|
Here's a list of boolean attributes drawn from the spec: kangax/html-minifier#63 (comment) Since that list might be out of date, I've applied the same methodology to produce an up to date list from the current HTML 5.1 spec: xquery version "3.0";
declare namespace html="http://www.w3.org/1999/xhtml";
import module namespace http="http://expath.org/ns/http-client";
<results>{
let $url := "http://www.w3.org/TR/html51/single-page.html"
let $request := <http:request href="{$url}" method="get"/>
let $response-body := http:send-request($request)[2]
let $hits := $response-body//text()[contains(., 'attribute boolean')]/following-sibling::html:a[1]
for $attribute in distinct-values($hits)
order by $attribute
return
<result>{$attribute}</result>
}</results> Results: <results>
<result>allowFullscreen</result>
<result>async</result>
<result>autofocus</result>
<result>autoplay</result>
<result>badInput</result>
<result>checked</result>
<result>closed</result>
<result>commandChecked</result>
<result>commandDisabled</result>
<result>commandHidden</result>
<result>compact</result>
<result>complete</result>
<result>controls</result>
<result>cookieEnabled</result>
<result>customError</result>
<result>declare</result>
<result>default</result>
<result>defaultChecked</result>
<result>defaultMuted</result>
<result>defaultSelected</result>
<result>defer</result>
<result>disabled</result>
<result>draggable</result>
<result>enabled</result>
<result>ended</result>
<result>formNoValidate</result>
<result>hidden</result>
<result>indeterminate</result>
<result>isContentEditable</result>
<result>isMap</result>
<result>itemScope</result>
<result>javaEnabled</result>
<result>loop</result>
<result>multiple</result>
<result>muted</result>
<result>noHref</result>
<result>noResize</result>
<result>noShade</result>
<result>noValidate</result>
<result>noWrap</result>
<result>onLine</result>
<result>open</result>
<result>patternMismatch</result>
<result>pauseOnExit</result>
<result>paused</result>
<result>persisted</result>
<result>rangeOverflow</result>
<result>rangeUnderflow</result>
<result>readOnly</result>
<result>required</result>
<result>reversed</result>
<result>scoped</result>
<result>seamless</result>
<result>seeking</result>
<result>selected</result>
<result>sortable</result>
<result>spellcheck</result>
<result>stepMismatch</result>
<result>tooLong</result>
<result>tooShort</result>
<result>translate</result>
<result>trueSpeed</result>
<result>typeMismatch</result>
<result>typeMustMatch</result>
<result>valid</result>
<result>valueMissing</result>
<result>visible</result>
<result>willValidate</result>
</results> |
I just hit this issue by following the steps described at http://www.exist-db.org/exist/apps/doc/development-starter which is kind of confusing for first-time developers using the |
Just took a quick look at the source code and the problem seems to be at https://github.com/eXist-db/exist/blob/develop/src/org/exist/util/serializer/HTML5Writer.java#L103 Would you be open to a PR implementing a check on the boolean whitelist as reported by @joewiz? |
@devatwork thanks for taking a look at this, PRs with fixes are always welcome. When you open the PR could you please indicate if the documentation is now working as expected or include any necessary adjustments in a separate PR at the docs |
This change fixes two problems: 1. The attribute name is not written at all if its value is equal. Happened only in the HTML5Writer.attribute(QName, String) function 2. Only omit the values which are equal to the attribute name for attributes that are considered boolean according to the HTML 5.1 spec Fixes eXist-db#777
This change fixes two problems: 1. The attribute name is not written at all if its value is equal. Happened only in the HTML5Writer.attribute(QName, String) function 2. Only omit the values which are equal to the attribute name for attributes that are considered boolean according to the HTML 5.1 spec Fixes eXist-db#777
This change fixes two problems: 1. The attribute name is not written at all if its value is equal. Happened only in the HTML5Writer.attribute(QName, String) function 2. Only omit the values which are equal to the attribute name for attributes that are considered boolean according to the HTML 5.1 spec Fixes eXist-db#777
With very recent build on develop branch,
will return
This causes the browser to report
... and the wiki app to behave strangely as some parameter will never be sent to the server, like
name
in :C.
The text was updated successfully, but these errors were encountered: