Skip to content
/ lxml Public

Ignore disabled form inputs#197

Merged
scoder merged 1 commit intolxml:masterfrom
kklemon:ignore-disabled-inputs
Aug 20, 2016
Merged

Ignore disabled form inputs#197
scoder merged 1 commit intolxml:masterfrom
kklemon:ignore-disabled-inputs

Conversation

@kklemon
Copy link

@kklemon kklemon commented Jun 29, 2016

Disabled input elements are not in included in the emerging request in general according to 1 and 2 which doesn't seems to be recognized by lxml yet.

These changes do not really implements the standard perfectly which includes also rules for which the disabled attribute would be invalid, but it's actually the way most browsers are handling it by disabling an input just when the disabled attribute is set at all independently of the actual value.

@scoder
Copy link
Member

scoder commented Jul 24, 2016

Thanks. Please provide a test.

@kklemon kklemon force-pushed the ignore-disabled-inputs branch from 3db7acd to bc6da1e Compare July 26, 2016 11:57
@kklemon
Copy link
Author

kklemon commented Jul 26, 2016

Done.

It seems like for XHTML the corresponding attribute would have to be exactly disabled="disabled" as XHTML does not support minimized attributes. I'm not sure if lxml does really distinguish here, but I noticed that it maybe could make sense to recognize this in the xhtml_to_html() function in lxml.html by unminimizing HTML attributes when converting to XHTML.

@scoder scoder merged commit 714b95c into lxml:master Aug 20, 2016
@scoder
Copy link
Member

scoder commented Aug 20, 2016

I think your idea of converting these back and forth in xhtml_to_html() and html_to_xhtml() is a good one. Could you code up a pull request for that, too?

@kklemon kklemon deleted the ignore-disabled-inputs branch August 23, 2016 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants