Re: attribute or CSS property?

On Tue, Dec 9, 2014 at 11:28 AM, Piotr KoszuliƄski <
p.koszulinski@cksource.com> 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.
>

If I understand you right, you are dealing with different elements that
look the same in structure, but of which some are editable and others
aren't? Do you have an example where this is used in an editor?


>
> 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.
>

OK, so basically we give up on direct Copy-paste handling by the browser? I
think you may be right that this may just be too complicated for the
browses to ever get right whereas the editor knows more exactly what it
wants.

However, it also means that we shouldn't need to consider copy-pasting when
discussing whether or not this should be a CSS attribute.


>
>
> PS.
>
> (...) but we'll probably need to take display:none into account (...)
>
>
> Visibility does not affect editability -
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=25908
>
>
>
> --
> Piotrek KoszuliƄski
> CKEditor JavaScript Lead Developer
>



-- 
Johannes Wilm
Fidus Writer
http://www.fiduswriter.org

Received on Tuesday, 9 December 2014 11:31:07 UTC