Skip to content
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

Add support for contenteditable elements. #533

Closed
wants to merge 1 commit into from
Closed

Add support for contenteditable elements. #533

wants to merge 1 commit into from

Conversation

david
Copy link

@david david commented Oct 27, 2011

This is based on #182, but I also added support for rack-test. Please let me know if any changes are needed.

@jnicklas
Copy link
Collaborator

There have been discussions surrounding this, somewhere on another issue or on the mailing list before. We came to the conclusion that it's not a good idea to add this.

@jnicklas jnicklas closed this Oct 28, 2011
@williscool
Copy link

Can you provide a link to this discussion?

The pages with these closed pull requests and issues are at the topic of the front page in the google search for

"capybara contenteditable"

@JonRowe
Copy link
Contributor

JonRowe commented Jul 17, 2012

+1 for a link to the discussion, cant find it by google myself, it seems like we should be able to edit the content of these elements...

@jnicklas
Copy link
Collaborator

I can't remember where the discussion took place, and google and github didn't help me either. But regarding this pull request, the question is: what would you do with this functionality. As far as I can see contenteditable really has no purpose in a driver which doesn't support JavaScript. contenteditable elements aren't treated as form elements, and thus aren't submitted along with form data.

I tried really hard to come up with a case where changing an element due to it having contenteditable would cause any kind of effect at all in the absence of JavaScript, and the only thing I could come up with is something like this:

<button type="submit" contenteditable="true" name="button">Change me</button>

A contenteditable button. Curisouly, I tried this in Chrome and yes, it does work, but it's a pretty ludicrous edge case isn't it?

Why then support something which doesn't make any sense. Note that Selenium already supports it, it just isn't tested.

@JonRowe
Copy link
Contributor

JonRowe commented Jul 17, 2012

I agree it makes no sense in drivers that don't support JS (other than uniformity maybe) but it does make sense for the JS drivers. Looking at the head it doesn't look like the selenium driver would support it as set doesn't do anything for element's it doesn't know how to manipulate, and content-editable is never mentioned, so you'd have to drop down to native and send_keys yourself... which makes me sad...

I'd be open to writing some tests for and making it work on selenium if the behaviour is agreeable but as the previous two PR's with this functionality have been rejected and I'm using a different driver anyway (poltergeist)...

@jnicklas
Copy link
Collaborator

@JonRowe I'm working on a major refactor of the test suite, which will affect how these tests would be written. I should be able to finish that up in the next couple of days. I'd suggest holding off until then, if you're interested in making this work in Selenium.

@JonRowe
Copy link
Contributor

JonRowe commented Dec 15, 2012

See pull request #911

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.

4 participants