mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Bug 592330 - [VKB] Enhance virtual keyboard support in the chrome UI - part 1 [r=mfinkle]
This commit is contained in:
parent
ed790c7e51
commit
a9baf5fb8a
@ -594,7 +594,10 @@
|
||||
this._isEditing = true;
|
||||
if (this.control) {
|
||||
this.setAttribute("selected", "true");
|
||||
this.control.scrollBoxObject.ensureElementIsVisible(this);
|
||||
let self = this;
|
||||
setTimeout(function() {
|
||||
self.control.scrollBoxObject.ensureElementIsVisible(self);
|
||||
}, 0);
|
||||
this.control.activeItem = this;
|
||||
}
|
||||
|
||||
@ -867,7 +870,6 @@
|
||||
|
||||
<field name="_type"/>
|
||||
<field name="_mode"/>
|
||||
<field name="_activeItem">null</field>
|
||||
<field name="_ignoreEditing">false</field>
|
||||
<field name="_parents">
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "parent-items");
|
||||
@ -893,6 +895,7 @@
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<field name="_activeItem">null</field>
|
||||
<property name="activeItem">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
@ -1029,6 +1032,14 @@
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="close">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.activeItem = null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="createItem">
|
||||
<parameter name="aItem"/>
|
||||
<body>
|
||||
|
@ -598,6 +598,11 @@ var BrowserUI = {
|
||||
Browser.loadURI(submission.uri.spec, { postData: submission.postData });
|
||||
},
|
||||
|
||||
updateCurrentBrowser: function _updateCurrentBrowser() {
|
||||
let state = (Elements.contentShowing.getAttribute("disabled") == "true") ? "Blur" : "Focus";
|
||||
Browser.selectedBrowser.messageManager.sendAsyncMessage("Browser:" + state, {});
|
||||
},
|
||||
|
||||
updateStar: function() {
|
||||
if (PlacesUtils.getMostRecentBookmarkForURI(Browser.selectedBrowser.currentURI) != -1)
|
||||
this.starButton.setAttribute("starred", "true");
|
||||
@ -1634,6 +1639,7 @@ var FindHelperUI = {
|
||||
|
||||
hide: function findHelperHide() {
|
||||
this._textbox.value = "";
|
||||
this._textbox.blur();
|
||||
this._container.hide(this);
|
||||
},
|
||||
|
||||
|
@ -280,9 +280,16 @@ var Browser = {
|
||||
getBrowser().style.display = "none";
|
||||
getBrowser().style.display = "block";
|
||||
|
||||
let curEl = document.activeElement;
|
||||
if (curEl && curEl.id != "inputhandler-overlay" && curEl.scrollIntoView)
|
||||
curEl.scrollIntoView(false);
|
||||
// We want to keep the current focused element into view if possible
|
||||
let currentElement = document.activeElement;
|
||||
let [scrollbox, scrollInterface] = ScrollUtils.getScrollboxFromElement(currentElement);
|
||||
if (currentElement && scrollbox && currentElement != scrollbox) {
|
||||
// retrieve the direct child of the scrollbox
|
||||
while (currentElement.parentNode != scrollbox)
|
||||
currentElement = currentElement.parentNode;
|
||||
|
||||
setTimeout(function() { scrollInterface.ensureElementIsVisible(currentElement) }, 0);
|
||||
}
|
||||
}
|
||||
window.addEventListener("resize", resizeHandler, false);
|
||||
|
||||
@ -1690,6 +1697,8 @@ IdentityHandler.prototype = {
|
||||
},
|
||||
|
||||
show: function ih_show() {
|
||||
Elements.contentShowing.setAttribute("disabled", "true");
|
||||
|
||||
// dismiss any dialog which hide the identity popup
|
||||
BrowserUI.activePanel = null;
|
||||
while (BrowserUI.activeDialog)
|
||||
@ -1709,6 +1718,8 @@ IdentityHandler.prototype = {
|
||||
},
|
||||
|
||||
hide: function ih_hide() {
|
||||
Elements.contentShowing.setAttribute("disabled", "false");
|
||||
|
||||
this._identityPopup.hidden = true;
|
||||
this._identityBox.removeAttribute("open");
|
||||
|
||||
|
@ -100,7 +100,7 @@
|
||||
</broadcasterset>
|
||||
|
||||
<observerset id="observerset">
|
||||
<observes id="observe_contentShowing" element="bcast_contentShowing" attribute="disabled"/>
|
||||
<observes id="observe_contentShowing" element="bcast_contentShowing" attribute="disabled" onbroadcast="BrowserUI.updateCurrentBrowser();"/>
|
||||
</observerset>
|
||||
|
||||
<commandset id="mainCommandSet">
|
||||
|
@ -339,6 +339,7 @@ Content.prototype = {
|
||||
|
||||
switch (aMessage.name) {
|
||||
case "Browser:Blur":
|
||||
gFocusManager.clearFocus(content);
|
||||
docShell.isActive = false;
|
||||
this._selected = false;
|
||||
break;
|
||||
|
@ -188,7 +188,7 @@ MouseModule.prototype = {
|
||||
// walk up the DOM tree in search of nearest scrollable ancestor. nulls are
|
||||
// returned if none found.
|
||||
let [targetScrollbox, targetScrollInterface, dragger]
|
||||
= this.getScrollboxFromElement(aEvent.target);
|
||||
= ScrollUtils.getScrollboxFromElement(aEvent.target);
|
||||
|
||||
// stop kinetic panning if targetScrollbox has changed
|
||||
if (this._kinetic.isActive() && this._dragger != dragger)
|
||||
@ -446,49 +446,17 @@ MouseModule.prototype = {
|
||||
this._downUpEvents.splice(0);
|
||||
},
|
||||
|
||||
/**
|
||||
* The default dragger object used by MouseModule when dragging a scrollable
|
||||
* element that provides no customDragger. Simply performs the expected
|
||||
* regular scrollBy calls on the scroller.
|
||||
*/
|
||||
_defaultDragger: {
|
||||
isDraggable: function isDraggable(target, scroller) {
|
||||
let sX = {}, sY = {};
|
||||
scroller.getScrolledSize(sX, sY);
|
||||
let rect = target.getBoundingClientRect();
|
||||
return { x: sX.value > rect.width, y: sY.value > rect.height };
|
||||
},
|
||||
|
||||
dragStart: function dragStart(cx, cy, target, scroller) {},
|
||||
|
||||
dragStop : function dragStop(dx, dy, scroller) {
|
||||
return this.dragMove(dx, dy, scroller);
|
||||
},
|
||||
|
||||
dragMove : function dragMove(dx, dy, scroller) {
|
||||
if (scroller.getPosition) {
|
||||
try {
|
||||
|
||||
let oldX = {}, oldY = {};
|
||||
scroller.getPosition(oldX, oldY);
|
||||
|
||||
scroller.scrollBy(dx, dy);
|
||||
|
||||
let newX = {}, newY = {};
|
||||
scroller.getPosition(newX, newY);
|
||||
|
||||
return (newX.value != oldX.value) || (newY.value != oldY.value);
|
||||
|
||||
} catch (e) { /* we have no time for whiny scrollers! */ }
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// -- Utility functions
|
||||
toString: function toString() {
|
||||
return '[MouseModule] {'
|
||||
+ '\n\tdragData=' + this._dragData + ', '
|
||||
+ 'dragger=' + this._dragger + ', '
|
||||
+ '\n\tdownUpEvents=' + this._downUpEvents + ', '
|
||||
+ 'length=' + this._downUpEvents.length + ', '
|
||||
+ '\n\ttargetScroller=' + this._targetScrollInterface + '}';
|
||||
}
|
||||
};
|
||||
|
||||
var ScrollUtils = {
|
||||
/**
|
||||
* Walk up (parentward) the DOM tree from elem in search of a scrollable element.
|
||||
* Return the element and its scroll interface if one is found, two nulls otherwise.
|
||||
@ -530,14 +498,45 @@ MouseModule.prototype = {
|
||||
return [scrollbox, qinterface, (scrollbox ? (scrollbox.customDragger || this._defaultDragger) : null)];
|
||||
},
|
||||
|
||||
toString: function toString() {
|
||||
return '[MouseModule] {'
|
||||
+ '\n\tdragData=' + this._dragData + ', '
|
||||
+ 'dragger=' + this._dragger + ', '
|
||||
+ '\n\tdownUpEvents=' + this._downUpEvents + ', '
|
||||
+ 'length=' + this._downUpEvents.length + ', '
|
||||
+ '\n\ttargetScroller=' + this._targetScrollInterface + '}';
|
||||
}
|
||||
/**
|
||||
* The default dragger object used by MouseModule when dragging a scrollable
|
||||
* element that provides no customDragger. Simply performs the expected
|
||||
* regular scrollBy calls on the scroller.
|
||||
*/
|
||||
_defaultDragger: {
|
||||
isDraggable: function isDraggable(target, scroller) {
|
||||
let sX = {}, sY = {};
|
||||
scroller.getScrolledSize(sX, sY);
|
||||
let rect = target.getBoundingClientRect();
|
||||
return { x: sX.value > rect.width, y: sY.value > rect.height };
|
||||
},
|
||||
|
||||
dragStart: function dragStart(cx, cy, target, scroller) {},
|
||||
|
||||
dragStop : function dragStop(dx, dy, scroller) {
|
||||
return this.dragMove(dx, dy, scroller);
|
||||
},
|
||||
|
||||
dragMove : function dragMove(dx, dy, scroller) {
|
||||
if (scroller.getPosition) {
|
||||
try {
|
||||
|
||||
let oldX = {}, oldY = {};
|
||||
scroller.getPosition(oldX, oldY);
|
||||
|
||||
scroller.scrollBy(dx, dy);
|
||||
|
||||
let newX = {}, newY = {};
|
||||
scroller.getPosition(newX, newY);
|
||||
|
||||
return (newX.value != oldX.value) || (newY.value != oldY.value);
|
||||
|
||||
} catch (e) { /* we have no time for whiny scrollers! */ }
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -718,6 +718,7 @@ placeitem[ui="manage"] > .bookmark-manage > image {
|
||||
|
||||
autocompleteresult,
|
||||
placeitem {
|
||||
-moz-user-focus: ignore;
|
||||
color: black;
|
||||
background-color: white;
|
||||
padding: 2px 4px;
|
||||
|
@ -58,6 +58,10 @@ label {
|
||||
}
|
||||
|
||||
/* Override any OS inverse themes */
|
||||
richlistbox {
|
||||
-moz-user-focus: ignore;
|
||||
}
|
||||
|
||||
richlistbox,
|
||||
textbox {
|
||||
color: black;
|
||||
@ -533,6 +537,7 @@ richlistbox {
|
||||
}
|
||||
|
||||
richlistitem {
|
||||
-moz-user-focus: ignore;
|
||||
min-height: 70px; /* row size */
|
||||
padding: 5px;
|
||||
border-bottom: 1px solid rgb(207,207,207);
|
||||
|
Loading…
x
Reference in New Issue
Block a user