Closed
Bug 1190382
Opened 9 years ago
Closed 9 years ago
Properties uselessly sent in the Findbar:Keypress message
Categories
(Toolkit :: Find Toolbar, defect)
Toolkit
Find Toolbar
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: neil, Assigned: Gijs)
References
Details
Attachments
(1 file)
The Findbar._onKeyPress handler in browser-content.js wants to pass its keypress message to the find bar chrome. It does this by shallow copying the event to an object, excluding the 7 properties which are of object and 8 of function type, however there are 199 properties that duplicate properties on the KeyboardEvent constructor (of which 8 are also on the Event constructor) and only 29 properties that are actually interesting. Uninteresting properties: NONE CAPTURING_PHASE AT_TARGET BUBBLING_PHASE ALT_MASK CONTROL_MASK SHIFT_MASK META_MASK SCROLL_PAGE_DOWN SCROLL_PAGE_UP DOM_KEY_LOCATION_STANDARD DOM_KEY_LOCATION_LEFT DOM_KEY_LOCATION_RIGHT DOM_KEY_LOCATION_NUMPAD DOM_VK_* Interesting properties: isTrusted charCode keyCode altKey ctrlKey shiftKey metaKey location repeat isComposing key code detail layerX layerY pageX pageY which rangeOffset cancelBubble isChar type eventPhase bubbles cancelable defaultPrevented timeStamp multipleActionsPrevented isSynthesized
Assignee | ||
Comment 1•9 years ago
|
||
Do you have a suggestion about usefully distinguishing what we want and what we don't want without whitelisting?
Flags: needinfo?(neil)
Reporter | ||
Comment 2•9 years ago
|
||
Yes, I wouldn't bother sending properties of KeyboardEvent itself.
Flags: needinfo?(neil)
Assignee | ||
Comment 3•9 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #2) > Yes, I wouldn't bother sending properties of KeyboardEvent itself. Note that this can't be done through hasOwnProperty, which returns false for all of the uninteresting properties.
Assignee | ||
Comment 4•9 years ago
|
||
Bug 1190382 - don't send useless KeyboardEvent properties, r?neil
Assignee | ||
Updated•9 years ago
|
Attachment #8694746 -
Flags: review?(neil)
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8694746 [details] MozReview Request: Bug 1190382 - don't send useless KeyboardEvent properties, r?neil Review request updated; see interdiff: https://reviewboard.mozilla.org/r/26863/diff/1-2/
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•9 years ago
|
||
(In reply to :Gijs Kruitbosch from comment #5) > Comment on attachment 8694746 [details] > MozReview Request: Bug 1190382 - don't send useless KeyboardEvent > properties, r?neil > > Review request updated; see interdiff: > https://reviewboard.mozilla.org/r/26863/diff/1-2/ Uh, ignore that link - you want https://reviewboard.mozilla.org/r/26863/ .
Reporter | ||
Comment 7•9 years ago
|
||
No, I'm pretty sure the link *I* want is https://reviewboard-hg.mozilla.org/gecko/rev/1bf62bfb0d9a
Reporter | ||
Comment 8•9 years ago
|
||
(In reply to Gijs Kruitbosch from comment #3) > Note that this can't be done through hasOwnProperty, which returns false for > all of the uninteresting properties. Huh, for some reason isTrusted is an own property of a keyboard event, but (as I expected) all of the other properties live on the prototype chain.
Reporter | ||
Comment 9•9 years ago
|
||
Comment on attachment 8694746 [details] MozReview Request: Bug 1190382 - don't send useless KeyboardEvent properties, r?neil LGTM
Attachment #8694746 -
Flags: review?(neil) → review+
Comment 12•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4a9a6f9a2cf4 https://hg.mozilla.org/mozilla-central/rev/ced582e28099
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•