Last Comment Bug 462735 - Setting contentEditable=false inside a document with designMode='on' fails
: Setting contentEditable=false inside a document with designMode='on' fails
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: x86 Windows XP
-- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Makoto Kato [:m_kato]
Depends on:
Blocks: 424615
  Show dependency treegraph
Reported: 2008-11-02 03:46 PST by Alfonso Martinez
Modified: 2010-05-05 05:29 PDT (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

testcase (499 bytes, text/html)
2008-11-02 03:46 PST, Alfonso Martinez
no flags Details

Description User image Alfonso Martinez 2008-11-02 03:46:34 PST
Created attachment 345935 [details]

According to if an element has contentEditable=false then it should not be editable, even if the rest of the document has designMode='on'.

This testcase proves that Firefox, Safari and Opera fail to disable the editing in such situation.
Comment 1 User image Masayuki Nakano [:masayuki] 2010-05-04 23:14:24 PDT
The designMode isn't same as contenteditable="true" on root element. designMode property of the *document* makes all contents editable. You can think that desingMode emulates HTML editor, contenteditable attribute makes a part of static document editable.

# I think that the spec should explain more.
Comment 2 User image Alfonso Martinez 2010-05-05 00:29:12 PDT
The steps detailed in the spec states that given that condition the element shouldn't be editable, and it explains how to handle both contentEditable and designMode. It clearly states that if an element is marked as contentEditable=false then the user shouldn't be able to edit it, no matter if the surrounding content is made editable due to setting in a higher node contentEditable = true or designMode = true in the document.

Without this feature it's not possible to create non-editable blocks in a document with designMode, so in the end it means that it isn't useful to use designMode at all because people sometimes want the ability to mark some sentence/word/html as block that it's a single entity that can't be edited in the normal way, and the solution for those situations is to use contentEditable=false.

Until the spec is changed to remove this sentence this is a bug. 
"or if it and its ancestors all have their contenteditable  attribute set to the inherit state but the Document  has designMode  enabled, then the UA must treat the element as editable (as described below)."

Note You need to log in before you can comment on or make changes to this bug.