Re: attribute or CSS property?


if you have are traversing the DOM detachd without applying CSS, how do you
check for whether a node is set to display:none?

Olivier suggested we should treat nodes set to display:none in a specific
way when it comes to caret movement. But if we say that we don't want to
consider CSS when predicting how with contenteditable elements behave, then
maybe we should leave that out as well in order to preserve consistency?

On Tue, Dec 9, 2014 at 11:28 AM, Piotr KoszuliƄski <> wrote:

> I had an informal conversations with my colleagues, who pointed out
>> that making them to attribute will allow browsers to determine
>> editability without computing styles, but we'll probably need to take
>> display:none into account, so I guess it won't make much differences.
> From an editor perspective attributes seem to be much better. We are often
> traversing DOM to check whether some element is inside editable container
> or not and we do that also on detached DOM (when processing input/output
> data). If we would need to check computed styles I think it would be both -
> slower and/or more limited/complicated.
> Moreover, the editable and non-editable elements would need to be marked
> somehow. These classes (or any other editor related markers) should not
> leaking to the database. So the data processing step, which I think all
> editors implement, is a must-have. Therefore, there's no problem with using
> attributes.
> PS.
> (...) but we'll probably need to take display:none into account (...)
> Visibility does not affect editability -
> --
> Piotrek KoszuliƄski
> CKEditor JavaScript Lead Developer

Johannes Wilm
Fidus Writer

Received on Tuesday, 9 December 2014 13:58:15 UTC