W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2011

[whatwg] Proposal: content-style attribute for contenteditable elements

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 17 May 2011 08:23:45 -0700
Message-ID: <BANLkTimTZA4_NSA1nAaMzn0Ssw=oT06EgQ@mail.gmail.com>
On Tue, May 17, 2011 at 1:09 AM, Markus Ernst <derernst at gmx.ch> wrote:
> Special cases:
> - If the linked CSS document contains declarations for the body element,
> they are applied to the contenteditable element itself. (This could be
> necessary in case of light text on dark backgrounds, where you want to apply
> the background to the contenteditable area.)

It would be cleaner to simply say that the contenteditable element
matches the :root pseudoclass in the linked sheet.

> Rationale:
> - In today's iframe-based online rich text editors, it is common to apply
> the styles of the target page of the edited text to the source document of
> the iframe. This is not possible in a <div contenteditable>.
> - For many use cases, such as forum and blog entries, or non-fullpage
> oriented web content management systems, <div contenteditable> is easier to
> implement than iframe-based editors. The only downside is the WYSIWYG issue.

Why not just use an <iframe> with a contenteditable inside the linked
page?  This also gives you the ability to link in arbitrary CSS and be
shielded from the outside page's CSS, and as long as the linked page
is same-origin, you can still fiddle with it from script in the outer

Received on Tuesday, 17 May 2011 08:23:45 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:33 UTC