<?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>22094</bug_id>
          
          <creation_ts>2013-05-20 04:10:43 +0000</creation_ts>
          <short_desc>Add &apos;target&apos; in InputMethodContext</short_desc>
          <delta_ts>2013-07-04 07:40:44 +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 - IME API</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Takayoshi Kochi">kochi</reporter>
          <assigned_to name="Takayoshi Kochi">kochi</assigned_to>
          <cc>adrianba</cc>
    
    <cc>masayuki</cc>
    
    <cc>mike</cc>
    
    <cc>mounir</cc>
    
    <cc>public-webapps</cc>
    
    <cc>travil</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>87892</commentid>
    <comment_count>0</comment_count>
    <who name="Takayoshi Kochi">kochi</who>
    <bug_when>2013-05-20 04:10:43 +0000</bug_when>
    <thetext>As described in Microsoft&apos;s IME API proposal
https://dvcs.w3.org/hg/ime-api/raw-file/tip/proposals/IMEProposal.html

add &apos;target&apos; property which is a back pointer to the associated input element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87919</commentid>
    <comment_count>1</comment_count>
    <who name="Masayuki Nakano">masayuki</who>
    <bug_when>2013-05-20 11:15:19 +0000</bug_when>
    <thetext>As I said in bug 22093 comment 2, I believe that the target should be the editing host element of the element. I.e., if the InputMethodContext instance is created for &lt;input&gt; or &lt;textarea&gt;, then, it must refer the element itself. Otherwise, i.e., created for an element in HTML editor, it must refer the editing host because editing host is the usual event target of key and composition DOM events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87933</commentid>
    <comment_count>2</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2013-05-20 19:17:48 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; As I said in bug 22093 comment 2, I believe that the target should be the
&gt; editing host element of the element. I.e., if the InputMethodContext
&gt; instance is created for &lt;input&gt; or &lt;textarea&gt;, then, it must refer the
&gt; element itself. Otherwise, i.e., created for an element in HTML editor, it
&gt; must refer the editing host because editing host is the usual event target
&gt; of key and composition DOM events.

Yes, this is the intent. We expect that the InputMethodContext for a contenteditable region should be the &quot;host element&quot; of the editing context, not any of the dynamic content inside. This same &quot;host element&quot; also forms the root for index parameters like the offsets of the composition text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87935</commentid>
    <comment_count>3</comment_count>
    <who name="Masayuki Nakano">masayuki</who>
    <bug_when>2013-05-20 19:53:50 +0000</bug_when>
    <thetext>Then,

https://dvcs.w3.org/hg/ime-api/raw-file/tip/proposals/IMEProposal.html#widl-HTMLElement-getInputContext-InputMethodContext
&gt; Returns an InputMethodContext interface associated with *this* element, regardless of whether it&apos;s editable or not.

&quot;this&quot; sounds strange for me.

Additionally, in following case, what happens?

&lt;body&gt;
  &lt;div id=&quot;parent&quot;&gt;
    &lt;div id=&quot;child&quot;&gt;
      &lt;em id=&quot;em&quot;&gt;foo bar&lt;/em&gt;.
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/body&gt;

var contextOfEm = document.getElementById(&quot;em&quot;).getInputContext();
var contentOfParent = document.getElementById(&quot;parent&quot;).getInputContext();

// Are the both result of .target are null?

document.getElementById(&quot;child&quot;).setAttribute(&quot;contenteditable&quot;, &quot;true&quot;);

// Is the result of contentOfEm.target the &lt;div id=&quot;child&quot;&gt; element, but contentOfParent.target is null?

document.body.setAttribute(&quot;contenteditable&quot;, &quot;true&quot;);

// Are the both result of .target the &lt;body&gt; element?

If so, each InputMethodContext instance needs to store the element which created the instance?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88309</commentid>
    <comment_count>4</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2013-05-28 22:10:54 +0000</bug_when>
    <thetext>We should change
Returns an InputMethodContext interface associated with this element, regardless of whether it&apos;s editable or not.

To

Returns an InputMethodContext interface associated with this element, regardless of whether it&apos;s editable or not. If this element is a child element of an editable region, then returns an InputMethodContext interface associated with the containing element of the editable region.

Turning something on the page into editable shouldn’t change the existing InputMethodContext instances of its child or parent elements, otherwise it’ll be too complicated to dynamically switch all the existing contexts. The developer should get those contexts again if he changes something into editable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90340</commentid>
    <comment_count>5</comment_count>
    <who name="Takayoshi Kochi">kochi</who>
    <bug_when>2013-07-04 07:40:44 +0000</bug_when>
    <thetext>I&apos;ll add this to the next working draft update.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>