<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25908</bug_id>
          
          <creation_ts>2014-05-28 08:35:09 +0000</creation_ts>
          <short_desc>Is element editable if it&apos;s hidden</short_desc>
          <delta_ts>2014-07-01 01:56:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - HTML Editing APIs</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Piotrek Reinmar Koszuliński">p.koszulinski</reporter>
          <assigned_to name="Aryeh Gregor">ayg</assigned_to>
          <cc>annevk</cc>
    
    <cc>m.lewandowski+w3c-bugs</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
    
    <cc>rniwa</cc>
          
          <qa_contact name="HTML Editing APIs spec bugbot">sideshowbarker+html-editing-api</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>106896</commentid>
    <comment_count>0</comment_count>
    <who name="Piotrek Reinmar Koszuliński">p.koszulinski</who>
    <bug_when>2014-05-28 08:35:09 +0000</bug_when>
    <thetext>https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#editable

What if element has contenteditable=true attribute but it&apos;s hidden. E.g.:

&lt;div style=&quot;display:none&quot;&gt;
  &lt;div contenteditable=&quot;true&quot;&gt;Am I editable?&lt;/div&gt;
&lt;/div&gt;

AFAIK Blink and Webkit sets isContentEditable to false on such attributes and in my opinion it makes sense - especially for editing hosts. Firefox and IE leaves isContentEditable true and therefore it would be good if this case was explained in specification.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106899</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-28 08:46:23 +0000</bug_when>
    <thetext>This should be true. We don&apos;t want isContentEditable to have to do synchronous style resolution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106900</commentid>
    <comment_count>2</comment_count>
    <who name="Piotrek Reinmar Koszuliński">p.koszulinski</who>
    <bug_when>2014-05-28 08:53:29 +0000</bug_when>
    <thetext>If you could include this information in the spec I could ask Blink and Webkit team to fix it. Currently, they made a conscious decision: https://code.google.com/p/chromium/issues/detail?id=313082#c4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106901</commentid>
    <comment_count>3</comment_count>
    <who name="Piotrek Reinmar Koszuliński">p.koszulinski</who>
    <bug_when>2014-05-28 09:02:28 +0000</bug_when>
    <thetext>Just to clarify. So isContentEditable is meant to be a faster alternative to traversing DOM tree down to the first element with contenteditable attribute set or document in design mode. Is this correct?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106902</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-28 09:09:32 +0000</bug_when>
    <thetext>Yes, HTML defers to HTML editing APIs for the definition of isContentEditable and there it is quite clear: https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#editable</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107022</commentid>
    <comment_count>5</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2014-05-30 10:01:09 +0000</bug_when>
    <thetext>(In reply to Anne from comment #4)
&gt; Yes, HTML defers to HTML editing APIs for the definition of
&gt; isContentEditable and there it is quite clear:
&gt; https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#editable

Don&apos;t put much stock in this definition, I made it up on a whim and didn&apos;t consider this issue.  That said, making it depend on CSS properties doesn&apos;t seem desirable to me offhand.  The reason given on the Chromium bug is

&gt; Since users can&apos;t edit elements not rendered, Blink considers
&gt; such elements aren&apos;t editable. This is reason why
&gt; isContentEditable returns false for elements which have
&gt; contenteditable=&quot;true&quot; attribute but hidden.

I don&apos;t find this convincing.  You can&apos;t access the inside of the element because you can&apos;t put the cursor there, but I wouldn&apos;t say that means it&apos;s not editable, just that you don&apos;t have any way to tell the UA to do anything to it.  It&apos;s perfectly editable if, say, script places the cursor there -- which is very relevant, since we&apos;re talking about a script-accessible property here.  Per spec, the editor doesn&apos;t treat hidden elements the same as non-editable elements at all.

(In reply to Anne from comment #1)
&gt; This should be true. We don&apos;t want isContentEditable to have to do
&gt; synchronous style resolution.

Ryosuke once told me that contenteditability is implemented by a CSS property in WebKit anyway, so they have to.  (In Gecko, it&apos;s implemented by a flag bit that&apos;s set and unset recursively as needed with special code.  This has caused bugs that the WebKit approach would probably have avoided.)

But I agree that this is another reason not to have it this way in the spec.  So in the absence of anyone actively editing the editing spec, I&apos;ll call this RESOLVED.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108539</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2014-07-01 01:56:14 +0000</bug_when>
    <thetext>Note that we&apos;ve recently fixed this bug in WebKit (http://trac.webkit.org/changeset/160966) so that isContentEditable returns true even inside an element with display:none: https://bugs.webkit.org/show_bug.cgi?id=133371</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>