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

fix Webkit (and Gecko) implementation fo contentEditable? #37

Closed
johanneswilm opened this issue Jan 13, 2013 · 0 comments
Closed

fix Webkit (and Gecko) implementation fo contentEditable? #37

johanneswilm opened this issue Jan 13, 2013 · 0 comments

Comments

@johanneswilm
Copy link
Contributor

Unfortunately it seems as if in both Webkit and Firefox this area seems to have been abandoned a while ago. If you look at the files here: http://trac.webkit.org/browser/trunk/Source/WebCore/editing?rev=133820&order=name those are the Webkit files related to editing. Some of these seem not to have had any major editing for 6 years+ (only small patches from users here and there). I'm trying to get around some of the limitations in Javascript, but it's driving me quite insane.

For example, I am currently wrestling with these issues in Webkit:

-- It likes to throw font-elements into the code without being asked for it. Font elements are not part of HTML5 and were deprecated in HTML4.01. There are numerous similar problems like this one.

-- Spaces at the end of paragraphs that are in their own span element (or any other inline element) are not displayed(!) The quick fix for this is CSS code such as:

span::after {
content: '.';
font-size:0;
}

I found that simply by trying it out. It basically adds a period after each span element, and then changes the font-size of that period to zero, so that the users doesn't actually have to see it.

-- A contentEditable=false element inside a contentEditable=true is being deleted as if it were one single character when hitting Backspace or Delete, the way one would expect. However, if three elements are stacked into one another (contentEditable=true inside of contentEditable=false inside of contentEditable=true) and one tries to remove the middle one using the backspace key, somehow the innermost and outermost content-editable elements are fused in an uncontrollable way. The behavior I would expect would be for both inner elements to be removed.


The code around contentEditable seems never to have been finished completely. There are numerous messages saying things such as "FIXME: ... This was done to match existing behavior, but it seems wrong."

Now the question is: If neither Apple nor Google nor Adobe nor anyone else saw any reason to fix any of this since 2006/07, what chances are there that this will happen in the future? Currently it seems almost easier to reprogram the entire contentEditable functionality in Javascript than to rely on the implementation in Webkit. Alternatively, one could try to fix Webkit. My C++ knowledge is quite rusty and given the time it takes to compile Webkit it's not exactly something one would one to do by trying around.

So the idea: What if we instead of trying to make a ton of Javascript implementations to work around the issues there are, try to fix Webkit instead?

Johannes Wilm
johannes.wilm@sourcefabric.org

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

No branches or pull requests

1 participant