Last Comment Bug 676520 - GCLI fails to read from input element when embedded
: GCLI fails to read from input element when embedded
Status: RESOLVED FIXED
[minotaur][best:1d, likely:3d, worst:5d]
:
Product: Firefox
Classification: Client Software
Component: Developer Tools (show other bugs)
: unspecified
: x86_64 Windows 7
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks: GCLI-ENABLE
  Show dependency treegraph
 
Reported: 2011-08-04 06:20 PDT by Joe Walker [:jwalker] (needinfo me or ping on irc)
Modified: 2011-08-22 00:52 PDT (History)
0 users
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Joe Walker [:jwalker] (needinfo me or ping on irc) 2011-08-04 06:20:10 PDT
HUDService creates a textbox for GCLI (line 6910)

https://hg.mozilla.org/users/jwalker_mozilla.com/gcli-patches/file/451c73812525/bug656666-hudservice.patch#l443

    this.inputNode = this.document.createElement("textbox");
    this.inputNode.setAttribute("class", "gcliterm-input-node");
    this.inputNode.setAttribute("multiline", "true");
    this.inputNode.setAttribute("rows", "1");

This is passed to GCLI (line 6849)

https://hg.mozilla.org/users/jwalker_mozilla.com/gcli-patches/file/451c73812525/bug656666-hudservice.patch#l382

  gcli._internal.createView({
    document: this.document,
    inputElement: this.inputNode,
    completeElement: this.completeNode,
    inputBackgroundElement: this.inputStack,
    completionPrompt: ''
  });

It the inputElement is passed to inputter.js and used as this.element (line 75)

https://github.com/mozilla/gcli/blob/d8fe0b795e13a73633246677ecc6d4ab61a09dfd/lib/gcli/ui/inputter.js#L75

When we read from the element, value is empty even when something has been typed in.
Comment 1 Joe Walker [:jwalker] (needinfo me or ping on irc) 2011-08-04 06:21:10 PDT
For the sake of posterity some debug code we were using in Inputter.updateCli:

  console.debug('input', input);
  console.debug('this.element', this.element);
  console.debug('gOPDv1', Object.getOwnPropertyDescriptor(this.element, 'value'));
  console.debug('this.completer.element', this.completer.element);
  console.debug('gOPDv2', Object.getOwnPropertyDescriptor(this.completer.element, 'value'));
  console.debug('_lS_v', this.element.__lookupSetter__('value'));

  var textbox = this.element;
  console.debug('textbox.value === undefined', textbox.value === undefined);
  //console.debug('textbox.getAttribute(value).length', textbox.getAttribute('value').length);
  console.debug('textbox.selectionStart', textbox.selectionStart);
  console.debug('textbox.type', textbox.getAttribute('type'));
  console.debug('textbox.size', textbox.getAttribute('size'));
Comment 2 Joe Walker [:jwalker] (needinfo me or ping on irc) 2011-08-19 09:02:37 PDT
Bug 680453 is the result of some study into this problem.
We have a workaround for now.

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