Merge mozilla-inbound and mozilla-central

This commit is contained in:
Marco Bonardo 2012-01-04 13:30:58 +01:00
commit d80774bd9c
20 changed files with 579 additions and 276 deletions

View File

@ -40,6 +40,7 @@
*
* ***** END LICENSE BLOCK ***** */
const Ci = Components.interfaces;
const Cu = Components.utils;
const FILTER_CHANGED_TIMEOUT = 300;
@ -289,7 +290,8 @@ CssHtmlTree.prototype = {
return false;
}
let propView = new PropertyView(this, aPropertyName);
fragment.appendChild(propView.build());
fragment.appendChild(propView.buildMain());
fragment.appendChild(propView.buildSelectorContainer());
if (propView.visible) {
this.numVisibleProperties++;
}
@ -517,6 +519,9 @@ PropertyView.prototype = {
// Property header node
propertyHeader: null,
// Destination for property names
nameNode: null,
// Destination for property values
valueNode: null,
@ -611,7 +616,7 @@ PropertyView.prototype = {
*
* @return string
*/
get className()
get propertyHeaderClassName()
{
if (this.visible) {
this.tree._darkStripe = !this.tree._darkStripe;
@ -622,28 +627,55 @@ PropertyView.prototype = {
return "property-view-hidden";
},
build: function PropertyView_build()
/**
* Returns the className that should be assigned to the propertyView content
* container.
* @return string
*/
get propertyContentClassName()
{
if (this.visible) {
let darkValue = this.tree._darkStripe ?
"property-content darkrow" : "property-content";
return darkValue;
}
return "property-content-hidden";
},
buildMain: function PropertyView_buildMain()
{
let doc = this.tree.doc;
this.element = doc.createElementNS(HTML_NS, "div");
this.element.setAttribute("class", this.className);
this.element = doc.createElementNS(HTML_NS, "tr");
this.element.setAttribute("class", this.propertyHeaderClassName);
this.element.addEventListener("click", this.propertyRowClick.bind(this), false);
this.propertyHeader = doc.createElementNS(XUL_NS, "hbox");
this.propertyHeader = doc.createElementNS(HTML_NS, "td");
this.element.appendChild(this.propertyHeader);
this.propertyHeader.setAttribute("class", "property-header");
this.propertyHeader.addEventListener("click", this.propertyHeaderClick.bind(this), false);
this.matchedExpander = doc.createElementNS(HTML_NS, "div");
this.propertyHeader.appendChild(this.matchedExpander);
this.matchedExpander.setAttribute("class", "match expander");
let name = doc.createElementNS(HTML_NS, "div");
this.propertyHeader.appendChild(name);
name.setAttribute("class", "property-name");
name.textContent = this.name;
this.nameNode = doc.createElementNS(HTML_NS, "div");
this.propertyHeader.appendChild(this.nameNode);
this.nameNode.setAttribute("tabindex", "0");
this.nameNode.addEventListener("keydown", function(aEvent) {
let keyEvent = Ci.nsIDOMKeyEvent;
if (aEvent.keyCode == keyEvent.DOM_VK_F1) {
this.mdnLinkClick();
}
if (aEvent.keyCode == keyEvent.DOM_VK_RETURN ||
aEvent.keyCode == keyEvent.DOM_VK_SPACE) {
this.propertyRowClick(aEvent);
}
}.bind(this), false);
let helpcontainer = doc.createElementNS(HTML_NS, "div");
this.propertyHeader.appendChild(helpcontainer);
this.nameNode.setAttribute("class", "property-name");
this.nameNode.textContent = this.name;
let helpcontainer = doc.createElementNS(HTML_NS, "td");
this.element.appendChild(helpcontainer);
helpcontainer.setAttribute("class", "helplink-container");
let helplink = doc.createElementNS(HTML_NS, "a");
@ -653,25 +685,35 @@ PropertyView.prototype = {
helplink.textContent = CssHtmlTree.HELP_LINK_TITLE;
helplink.addEventListener("click", this.mdnLinkClick.bind(this), false);
this.valueNode = doc.createElementNS(HTML_NS, "div");
this.propertyHeader.appendChild(this.valueNode);
this.valueNode = doc.createElementNS(HTML_NS, "td");
this.element.appendChild(this.valueNode);
this.valueNode.setAttribute("class", "property-value");
this.valueNode.setAttribute("dir", "ltr");
this.valueNode.textContent = this.value;
this.matchedSelectorsContainer = doc.createElementNS(HTML_NS, "div");
this.element.appendChild(this.matchedSelectorsContainer);
this.matchedSelectorsContainer.setAttribute("class", "rulelink");
return this.element;
},
buildSelectorContainer: function PropertyView_buildSelectorContainer()
{
let doc = this.tree.doc;
let element = doc.createElementNS(HTML_NS, "tr");
element.setAttribute("class", this.propertyContentClassName);
this.matchedSelectorsContainer = doc.createElementNS(HTML_NS, "td");
this.matchedSelectorsContainer.setAttribute("colspan", "0");
this.matchedSelectorsContainer.setAttribute("class", "rulelink");
element.appendChild(this.matchedSelectorsContainer);
return element;
},
/**
* Refresh the panel's CSS property value.
*/
refresh: function PropertyView_refresh()
{
this.element.className = this.className;
this.element.className = this.propertyHeaderClassName;
this.element.nextElementSibling.className = this.propertyContentClassName;
if (this.prevViewedElement != this.tree.viewedElement) {
this._matchedSelectorViews = null;
@ -681,7 +723,7 @@ PropertyView.prototype = {
if (!this.tree.viewedElement || !this.visible) {
this.valueNode.innerHTML = "";
this.matchedSelectorsContainer.hidden = true;
this.matchedSelectorsContainer.parentNode.hidden = true;
this.matchedSelectorsContainer.innerHTML = "";
this.matchedExpander.removeAttribute("open");
return;
@ -698,12 +740,12 @@ PropertyView.prototype = {
refreshMatchedSelectors: function PropertyView_refreshMatchedSelectors()
{
let hasMatchedSelectors = this.hasMatchedSelectors;
this.matchedSelectorsContainer.hidden = !hasMatchedSelectors;
this.matchedSelectorsContainer.parentNode.hidden = !hasMatchedSelectors;
if (hasMatchedSelectors) {
this.propertyHeader.classList.add("expandable");
this.propertyHeader.parentNode.classList.add("expandable");
} else {
this.propertyHeader.classList.remove("expandable");
this.propertyHeader.parentNode.classList.remove("expandable");
}
if (this.matchedExpanded && hasMatchedSelectors) {
@ -802,11 +844,12 @@ PropertyView.prototype = {
* event. If the class name is "helplink" then the event is allowed to bubble
* to the mdn link icon.
*/
propertyHeaderClick: function PropertyView_propertyHeaderClick(aEvent)
propertyRowClick: function PropertyView_propertyRowClick(aEvent)
{
if (aEvent.target.className != "helplink") {
this.matchedExpanded = !this.matchedExpanded;
this.refreshAllSelectors();
this.nameNode.focus();
aEvent.preventDefault();
}
},

View File

@ -69,8 +69,8 @@
</div>
<!-- The output from #templateProperty (below) is appended here. -->
<div id="propertyContainer">
</div>
<table id="propertyContainer">
</table>
<xul:hbox id="footer">
<xul:label class="legendKey bestmatch">&bestMatch;</xul:label>

View File

@ -50,6 +50,7 @@ _BROWSER_TEST_FILES = \
browser_bug683672.js \
browser_styleinspector_bug_672746_default_styles.js \
browser_styleinspector_bug_672744_search_filter.js \
browser_bug589375_keybindings.js \
browser_styleinspector_bug_689759_no_results_placeholder.js \
browser_bug_692400_element_style.js \
browser_csslogic_inherited.js \

View File

@ -0,0 +1,149 @@
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that the key bindings work properly.
let doc;
let stylePanel;
function createDocument()
{
doc.body.innerHTML = '<style type="text/css"> ' +
'.matches {color: #F00;}</style>' +
'<span class="matches">Some styled text</span>' +
'</div>';
doc.title = "Style Inspector key binding test";
ok(window.StyleInspector, "StyleInspector exists");
stylePanel = new StyleInspector(window);
Services.obs.addObserver(runStyleInspectorTests, "StyleInspector-opened", false);
stylePanel.createPanel(false, function() {
stylePanel.open(doc.body);
});
}
function runStyleInspectorTests()
{
Services.obs.removeObserver(runStyleInspectorTests, "StyleInspector-opened", false);
ok(stylePanel.isOpen(), "style inspector is open");
Services.obs.addObserver(SI_test, "StyleInspector-populated", false);
SI_inspectNode();
}
function SI_inspectNode()
{
var span = doc.querySelector(".matches");
ok(span, "captain, we have the matches span");
let htmlTree = stylePanel.cssHtmlTree;
stylePanel.selectNode(span);
is(span, htmlTree.viewedElement,
"style inspector node matches the selected node");
is(htmlTree.viewedElement, stylePanel.cssLogic.viewedElement,
"cssLogic node matches the cssHtmlTree node");
}
function SI_test()
{
Services.obs.removeObserver(SI_test, "StyleInspector-populated", false);
info("checking keybindings");
let iframe = stylePanel.iframe;
let searchbar = stylePanel.cssHtmlTree.searchField;
let propView = getFirstVisiblePropertyView();
let rulesTable = propView.matchedSelectorsContainer;
let nameNode = propView.nameNode;
info("Adding focus event handler to property name node");
nameNode.addEventListener("focus", function nameFocused() {
this.removeEventListener("focus", nameFocused);
info("property name is focused");
info("checking expand / collapse");
testKey(iframe.contentWindow, "VK_SPACE", rulesTable);
testKey(iframe.contentWindow, "VK_RETURN", rulesTable);
checkHelpLinkKeybinding();
Services.obs.addObserver(finishUp, "StyleInspector-closed", false);
stylePanel.close();
});
info("Adding focus event handler to search filter");
searchbar.addEventListener("focus", function searchbarFocused() {
this.removeEventListener("focus", searchbarFocused);
info("search filter is focused");
info("tabbing to property name node");
EventUtils.synthesizeKey("VK_TAB", {}, iframe.contentWindow);
});
info("Making sure that the style inspector panel is focused");
SimpleTest.waitForFocus(function windowFocused() {
info("window is focused");
info("focusing search filter");
searchbar.focus();
}, stylePanel.iframe.contentWindow);
}
function getFirstVisiblePropertyView()
{
let propView = null;
stylePanel.cssHtmlTree.propertyViews.some(function(aPropView) {
if (aPropView.visible) {
propView = aPropView;
return true;
}
});
return propView;
}
function testKey(aContext, aVirtKey, aRulesTable)
{
info("testing " + aVirtKey + " key");
info("expanding rules table");
EventUtils.synthesizeKey(aVirtKey, {}, aContext);
isnot(aRulesTable.innerHTML, "", "rules Table is populated");
info("collapsing rules table");
EventUtils.synthesizeKey(aVirtKey, {}, aContext);
is(aRulesTable.innerHTML, "", "rules Table is not populated");
}
function checkHelpLinkKeybinding()
{
info("checking help link keybinding");
let iframe = stylePanel.iframe;
let propView = getFirstVisiblePropertyView();
info("check that MDN link is opened on \"F1\"");
let linkClicked = false;
propView.mdnLinkClick = function(aEvent) {
linkClicked = true;
};
EventUtils.synthesizeKey("VK_F1", {}, iframe.contentWindow);
is(linkClicked, true, "MDN link will be shown");
}
function finishUp()
{
Services.obs.removeObserver(finishUp, "StyleInspector-closed", false);
ok(!stylePanel.isOpen(), "style inspector is closed");
doc = stylePanel = null;
gBrowser.removeCurrentTab();
finish();
}
function test()
{
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function onLoad(evt) {
gBrowser.selectedBrowser.removeEventListener(evt.type, onLoad, true);
doc = content.document;
waitForFocus(createDocument, content);
}, true);
content.location = "data:text/html,default styles test";
}

View File

@ -514,7 +514,7 @@ TiltGL.Renderer.prototype = {
*/
scale: function TGLR_scale(x, y, z)
{
mat4.scale(this.mvMatrix, [x, y, z || 0]);
mat4.scale(this.mvMatrix, [x, y, z || 1]);
},
/**

View File

@ -650,12 +650,25 @@ TiltUtils.getWindowId = function TU_getWindowId(aWindow)
.currentInnerWindowID;
};
/**
* Gets the markup document viewer zoom for the currently selected browser.
*
* @return {Number} the zoom ammount
*/
TiltUtils.getDocumentZoom = function TU_getDocumentZoom() {
let browserWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
.getService(Ci.nsIWindowMediator)
.getMostRecentWindow("navigator:browser");
return browserWindow.gBrowser.selectedBrowser.markupDocumentViewer.fullZoom;
};
/**
* Performs a garbage collection.
*/
TiltUtils.gc = function TU_gc()
{
var browserWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
let browserWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
.getService(Ci.nsIWindowMediator)
.getMostRecentWindow("navigator:browser");

View File

@ -221,6 +221,7 @@ TiltVisualizer.Presenter = function TV_Presenter(
* Modified by events in the controller through delegate functions.
*/
this.transforms = {
zoom: TiltUtils.getDocumentZoom(),
offset: vec3.create(), // mesh offset, aligned to the viewport center
translation: vec3.create(), // scene translation, on the [x, y, z] axis
rotation: quat4.create() // scene rotation, expressed as a quaternion
@ -338,6 +339,8 @@ TiltVisualizer.Presenter.prototype = {
renderer.translate(transforms.offset[0],
transforms.offset[1] + transforms.translation[1], 0);
renderer.scale(transforms.zoom, transforms.zoom);
// draw the visualization mesh
renderer.strokeWeight(2);
renderer.depthTest(true);
@ -492,12 +495,13 @@ TiltVisualizer.Presenter.prototype = {
this.highlightNode(this.inspectorUI.selection);
}
let width = renderer.width;
let height = renderer.height;
let zoom = TiltUtils.getDocumentZoom();
let width = Math.min(aData.meshWidth * zoom, renderer.width);
let height = Math.min(aData.meshHeight * zoom, renderer.height);
// set the necessary mesh offsets
this.transforms.offset[0] = -Math.min(aData.meshWidth, width) * 0.5;
this.transforms.offset[1] = -Math.min(aData.meshHeight, height) * 0.5;
this.transforms.offset[0] = -width * 0.5;
this.transforms.offset[1] = -height * 0.5;
// make sure the canvas is opaque now that the initialization is finished
this.canvas.style.background = TiltVisualizerStyle.canvas.background;
@ -559,8 +563,9 @@ TiltVisualizer.Presenter.prototype = {
*/
onResize: function TVP_onResize(e)
{
let width = e.target.innerWidth;
let height = e.target.innerHeight;
let zoom = TiltUtils.getDocumentZoom();
let width = e.target.innerWidth * zoom;
let height = e.target.innerHeight * zoom;
// handle aspect ratio changes to update the projection matrix
this.renderer.width = width;
@ -703,9 +708,12 @@ TiltVisualizer.Presenter.prototype = {
}
}, false);
let width = this.renderer.width;
let height = this.renderer.height;
let zoom = TiltUtils.getDocumentZoom();
let width = this.renderer.width * zoom;
let height = this.renderer.height * zoom;
let mesh = this.meshStacks;
x *= zoom;
y *= zoom;
// create a ray following the mouse direction from the near clipping plane
// to the far clipping plane, to check for intersections with the mesh,
@ -988,7 +996,11 @@ TiltVisualizer.Controller.prototype = {
e.preventDefault();
e.stopPropagation();
}
this.arcball.keyDown(code);
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) {
this.arcball.cancelKeyEvents();
} else {
this.arcball.keyDown(code);
}
},
/**
@ -1013,7 +1025,7 @@ TiltVisualizer.Controller.prototype = {
* Called when the canvas looses focus.
*/
onBlur: function TVC_onBlur(e) {
this.arcball._keyCode = {};
this.arcball.cancelKeyEvents();
},
/**
@ -1021,8 +1033,9 @@ TiltVisualizer.Controller.prototype = {
*/
onResize: function TVC_onResize(e)
{
let width = e.target.innerWidth;
let height = e.target.innerHeight;
let zoom = TiltUtils.getDocumentZoom();
let width = e.target.innerWidth * zoom;
let height = e.target.innerHeight * zoom;
this.arcball.resize(width, height);
},
@ -1468,6 +1481,13 @@ TiltVisualizer.Arcball.prototype = {
}
},
/**
* Cancels all pending transformations caused by key events.
*/
cancelKeyEvents: function TVA_cancelKeyEvents() {
this._keyCode = {};
},
/**
* Resize this implementation to use different bounds.
* This function is automatically called when the arcball is created.

View File

@ -76,6 +76,7 @@ _BROWSER_TEST_FILES = \
browser_tilt_utils05.js \
browser_tilt_utils06.js \
browser_tilt_visualizer.js \
browser_tilt_zoom.js \
$(NULL)
libs:: $(_BROWSER_TEST_FILES)

View File

@ -45,36 +45,55 @@ function test() {
"At init, the rotation should be zero.");
EventUtils.synthesizeKey("VK_A", { type: "keydown" });
EventUtils.synthesizeKey("VK_LEFT", { type: "keydown" });
instance.controller.update();
ok(!isEqualVec(tran(), prev_tran),
"After a translation key is pressed, the vector should change.");
ok(!isEqualVec(rot(), prev_rot),
"After a rotation key is pressed, the quaternion should change.");
save();
gBrowser.selectedBrowser.contentWindow.focus();
instance.controller.update();
ok(!isEqualVec(tran(), prev_tran),
"Even if the canvas lost focus, the vector has some inertia.");
ok(!isEqualVec(rot(), prev_rot),
"Even if the canvas lost focus, the quaternion has some inertia.");
save();
while (!isEqualVec(tran(), prev_tran) || !isEqualVec(rot(), prev_rot)) {
function testEventCancel(cancellingEvent) {
EventUtils.synthesizeKey("VK_A", { type: "keydown" });
EventUtils.synthesizeKey("VK_LEFT", { type: "keydown" });
instance.controller.update();
ok(!isEqualVec(tran(), prev_tran),
"After a translation key is pressed, the vector should change.");
ok(!isEqualVec(rot(), prev_rot),
"After a rotation key is pressed, the quaternion should change.");
save();
cancellingEvent();
instance.controller.update();
ok(!isEqualVec(tran(), prev_tran),
"Even if the canvas lost focus, the vector has some inertia.");
ok(!isEqualVec(rot(), prev_rot),
"Even if the canvas lost focus, the quaternion has some inertia.");
save();
while (!isEqualVec(tran(), prev_tran) ||
!isEqualVec(rot(), prev_rot)) {
instance.controller.update();
save();
}
ok(isEqualVec(tran(), prev_tran) && isEqualVec(rot(), prev_rot),
"After focus lost, the transforms inertia eventually stops.");
}
ok(isEqualVec(tran(), prev_tran) && isEqualVec(rot(), prev_rot),
"After the focus is lost, the transforms inertia eventually stops.");
testEventCancel(function() {
EventUtils.synthesizeKey("T", { type: "keydown", altKey: 1 });
});
testEventCancel(function() {
EventUtils.synthesizeKey("I", { type: "keydown", ctrlKey: 1 });
});
testEventCancel(function() {
EventUtils.synthesizeKey("L", { type: "keydown", metaKey: 1 });
});
testEventCancel(function() {
EventUtils.synthesizeKey("T", { type: "keydown", shiftKey: 1 });
});
testEventCancel(function() {
gBrowser.selectedBrowser.contentWindow.focus();
});
},
onEnd: function()
{

View File

@ -113,4 +113,14 @@ function test() {
ok(isApproxVec(renderer.mvMatrix, [
1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1
]), "The origin wasn't reset to identity correctly.");
renderer.translate(1, 2);
ok(isApproxVec(renderer.mvMatrix, [
1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 0, 1
]), "The second translation transformation wasn't applied correctly.");
renderer.scale(3, 4);
ok(isApproxVec(renderer.mvMatrix, [
3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 1, 0, 1, 2, 0, 1
]), "The second scale transformation wasn't applied correctly.");
}

View File

@ -99,6 +99,8 @@ function testPresenter(presenter) {
"The presenter highlight fourth vertex should be initially zeroed.");
ok(presenter.transforms,
"The presenter transforms wasn't initialized properly.");
ok(isApproxVec(presenter.transforms.zoom, 1),
"The presenter transforms zoom should be initially 1.");
ok(isApproxVec(presenter.transforms.offset, [0, 0, 0]),
"The presenter transforms offset should be initially zeroed.");
ok(isApproxVec(presenter.transforms.translation, [0, 0, 0]),

View File

@ -0,0 +1,98 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/*global ok, is, info, waitForExplicitFinish, finish, executeSoon, gBrowser */
/*global isApprox, isTiltEnabled, isWebGLSupported, createTab, createTilt */
/*global Services, EventUtils, TiltUtils, InspectorUI, TILT_DESTROYED */
"use strict";
const ZOOM = 2;
const RESIZE = 50;
function setZoom(value) {
gBrowser.selectedBrowser.markupDocumentViewer.fullZoom = value;
}
function getZoom() {
return gBrowser.selectedBrowser.markupDocumentViewer.fullZoom;
}
function test() {
setZoom(Math.random());
is(getZoom(), TiltUtils.getDocumentZoom(),
"The getDocumentZoom utility function didn't return the expected results.");
if (!isTiltEnabled()) {
info("Skipping controller test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
info("Skipping controller test because WebGL isn't supported.");
return;
}
waitForExplicitFinish();
createTab(function() {
createTilt({
onInspectorOpen: function()
{
setZoom(ZOOM);
},
onTiltOpen: function(instance)
{
ok(isApprox(instance.presenter.transforms.zoom, ZOOM),
"The presenter transforms zoom wasn't initially set correctly.");
let contentWindow = gBrowser.selectedBrowser.contentWindow;
let initialWidth = contentWindow.innerWidth;
let initialHeight = contentWindow.innerHeight;
let renderer = instance.presenter.renderer;
let arcball = instance.controller.arcball;
ok(isApprox(contentWindow.innerWidth * ZOOM, renderer.width, 1),
"The renderer width wasn't set correctly.");
ok(isApprox(contentWindow.innerHeight * ZOOM, renderer.height, 1),
"The renderer height wasn't set correctly.");
ok(isApprox(contentWindow.innerWidth * ZOOM, arcball.width, 1),
"The arcball width wasn't set correctly.");
ok(isApprox(contentWindow.innerHeight * ZOOM, arcball.height, 1),
"The arcball height wasn't set correctly.");
window.resizeBy(-RESIZE * ZOOM, -RESIZE * ZOOM);
executeSoon(function() {
ok(isApprox(contentWindow.innerWidth + RESIZE, initialWidth, 1),
"The content window width wasn't set correctly.");
ok(isApprox(contentWindow.innerHeight + RESIZE, initialHeight, 1),
"The content window height wasn't set correctly.");
ok(isApprox(contentWindow.innerWidth * ZOOM, renderer.width, 1),
"The renderer width wasn't set correctly.");
ok(isApprox(contentWindow.innerHeight * ZOOM, renderer.height, 1),
"The renderer height wasn't set correctly.");
ok(isApprox(contentWindow.innerWidth * ZOOM, arcball.width, 1),
"The arcball width wasn't set correctly.");
ok(isApprox(contentWindow.innerHeight * ZOOM, arcball.height, 1),
"The arcball height wasn't set correctly.");
window.resizeBy(RESIZE * ZOOM, RESIZE * ZOOM);
Services.obs.addObserver(cleanup, TILT_DESTROYED, false);
InspectorUI.closeInspectorUI();
});
},
});
});
}
function cleanup() {
Services.obs.removeObserver(cleanup, TILT_DESTROYED);
gBrowser.removeCurrentTab();
finish();
}

View File

@ -1,7 +1,7 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/*global Services, Components, gBrowser, executeSoon */
/*global Services, Components, gBrowser, executeSoon, info */
/*global InspectorUI, Tilt, TiltGL, EPSILON */
"use strict";
@ -53,16 +53,24 @@ function isWebGLSupported() {
return TiltGL.isWebGLSupported() && TiltGL.create3DContext(createCanvas());
}
function isApprox(num1, num2) {
return Math.abs(num1 - num2) < EPSILON;
function isApprox(num1, num2, delta) {
if (Math.abs(num1 - num2) > (delta || EPSILON)) {
info("isApprox expected " + num1 + ", got " + num2 + " instead.");
return false;
}
return true;
}
function isApproxVec(vec1, vec2) {
function isApproxVec(vec1, vec2, delta) {
vec1 = Array.prototype.slice.call(vec1);
vec2 = Array.prototype.slice.call(vec2);
if (vec1.length !== vec2.length) {
return false;
}
for (let i = 0, len = vec1.length; i < len; i++) {
if (!isApprox(vec1[i], vec2[i])) {
if (!isApprox(vec1[i], vec2[i], delta)) {
info("isApproxVec expected [" + vec1 + "], got [" + vec2 + "] instead.");
return false;
}
}
@ -70,11 +78,15 @@ function isApproxVec(vec1, vec2) {
}
function isEqualVec(vec1, vec2) {
vec1 = Array.prototype.slice.call(vec1);
vec2 = Array.prototype.slice.call(vec2);
if (vec1.length !== vec2.length) {
return false;
}
for (let i = 0, len = vec1.length; i < len; i++) {
if (vec1[i] !== vec2[i]) {
info("isEqualVec expected [" + vec1 + "], got [" + vec2 + "] instead.");
return false;
}
}

View File

@ -2122,6 +2122,7 @@ panel[dimmed="true"] {
.inspector-breadcrumbs-button {
-moz-appearance: none;
background-color: transparent;
border-style: solid;
border-width: 1px 13px 2px 13px;
color: hsl(210,30%,85%);
max-width: 85px;
@ -2153,57 +2154,57 @@ panel[dimmed="true"] {
}
.inspector-breadcrumbs-button {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:not([checked]),
.inspector-breadcrumbs-button:not([checked]):hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked] {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked][siblings-menu-open],
.inspector-breadcrumbs-button[checked]:hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type:not([checked]),
.inspector-breadcrumbs-button:first-of-type:not([checked]):hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type[checked] {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type[checked],
.inspector-breadcrumbs-button:first-of-type[checked]:hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type:not([checked]),
.inspector-breadcrumbs-button:last-of-type:not([checked]):hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type[checked] {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type[checked],
.inspector-breadcrumbs-button:last-of-type[checked]:hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected-pressed.png") 1 13 2 13 fill stretch;
}
/* Highlighter toolbar - breadcrumbs - RTL */
@ -2213,55 +2214,55 @@ panel[dimmed="true"] {
}
.inspector-breadcrumbs-button:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:not([checked]):-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:not([checked]):hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked]:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked][siblings-menu-open]:-moz-locale-dir(rtl),
.inspector-breadcrumbs-button[checked]:hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type:not([checked]):-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:first-of-type:not([checked]):hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type[checked]:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type[checked]:-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:first-of-type[checked]:hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type:not([checked]):-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:last-of-type:not([checked]):hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type[checked]:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type[checked]:-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:last-of-type[checked]:hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected-pressed.png") 1 13 2 13 fill stretch;
}

View File

@ -51,17 +51,9 @@
.property-header {
padding: 4px;
-moz-padding-start: 0;
-moz-padding-end: 5px;
}
.rule-unmatched {
cursor: pointer;
padding: 2px;
-moz-padding-start: 4px;
-moz-padding-end: 0;
padding: 5px 0;
white-space: nowrap;
vertical-align: text-top;
}
/* Take away these two :visited rules to get a core dumper */
@ -77,11 +69,6 @@
text-decoration: none;
}
.helplink-container {
position: relative;
top: 2px;
}
.helplink {
display: block;
height: 14px;
@ -90,25 +77,25 @@
-moz-padding-start: 14px;
background-image: url("chrome://browser/skin/devtools/goto-mdn.png");
-moz-margin-end: 2px;
cursor: pointer;
}
.property-header:not(:hover) > .helplink-container {
.property-view:not(:hover) > .helplink-container {
visibility: hidden;
}
.unmatchedSelectorTable {
-moz-margin-start: 15px;
}
.rulelink {
color: -moz-dialogtext;
-moz-margin-start: 12px;
padding: 0;
}
.expander {
-moz-appearance: treetwisty;
-moz-margin-start: 10px;
padding-top: 12px;
-moz-margin-start: 5px;
-moz-margin-end: 5px;
display: inline-block;
vertical-align: middle;
}
.expander[open] {
@ -123,25 +110,25 @@
visibility: hidden;
}
.expandable > .match {
.expandable > .property-header > .match {
visibility: visible;
}
.only-unmatched {
-moz-margin-start: 0;
}
.property-name {
font-size: 12px;
color: -moz-FieldText;
width: 220px;
display: inline-block;
}
.property-value {
padding: 0;
font-size: 10px;
color: grey;
vertical-align: text-top;
width: 100%;
}
.property-view-hidden {
.property-view-hidden,
.property-content-hidden {
display: none;
}
@ -153,7 +140,8 @@
/* This rule is necessary because Templater.jsm breaks LTR TDs in RTL docs */
.rule-text {
direction: ltr;
-moz-padding-start: 15px;
padding: 0;
-moz-padding-start: 20px;
}
.bestmatch {
@ -165,15 +153,13 @@
.parentmatch {
color: #666;
}
.unmatched {
color: brown;
}
#propertyContainer {
display: -moz-box;
-moz-box-orient: vertical;
-moz-box-flex: 1;
overflow-y: auto;
border-collapse: collapse;
}
.darkrow {
@ -189,7 +175,6 @@
.headerControls {
color: -moz-dialogtext;
background-color: -moz-dialog;
padding-top: 5px;
}
.onlyuserstyles {
@ -197,14 +182,6 @@
font-size: 11px;
}
.searchfield {
-moz-margin-start: 10px;
}
.styleinspector-legend {
-moz-margin-start: 12px;
}
#footer {
border-top: 1px solid -moz-dialog;
}

View File

@ -2858,6 +2858,7 @@ panel[dimmed="true"] {
.inspector-breadcrumbs-button {
-moz-appearance: none;
border-style: solid;
border-width: 1px 13px 2px 13px;
color: hsl(210,30%,85%);
max-width: 85px;
@ -2889,57 +2890,57 @@ panel[dimmed="true"] {
}
.inspector-breadcrumbs-button {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:not([checked]),
.inspector-breadcrumbs-button:not([checked]):hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked] {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked][siblings-menu-open],
.inspector-breadcrumbs-button[checked]:hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type:not([checked]),
.inspector-breadcrumbs-button:first-of-type:not([checked]):hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type[checked] {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type[checked],
.inspector-breadcrumbs-button:first-of-type[checked]:hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type:not([checked]),
.inspector-breadcrumbs-button:last-of-type:not([checked]):hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type[checked] {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type[checked],
.inspector-breadcrumbs-button:last-of-type[checked]:hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected-pressed.png") 1 13 2 13 fill stretch;
}
/* Highlighter toolbar - breadcrumbs - RTL */
@ -2949,55 +2950,55 @@ panel[dimmed="true"] {
}
.inspector-breadcrumbs-button:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:not([checked]):-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:not([checked]):hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked]:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked][siblings-menu-open]:-moz-locale-dir(rtl),
.inspector-breadcrumbs-button[checked]:hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type:not([checked]):-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:first-of-type:not([checked]):hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type[checked]:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type[checked]:-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:first-of-type[checked]:hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type:not([checked]):-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:last-of-type:not([checked]):hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-pressed.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type[checked]:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected.png") 1 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type[checked]:-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:last-of-type[checked]:hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected-pressed.png") 1 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected-pressed.png") 1 13 2 13 fill stretch;
}

View File

@ -51,17 +51,9 @@
.property-header {
padding: 4px;
-moz-padding-start: 0;
-moz-padding-end: 5px;
}
.rule-unmatched {
cursor: pointer;
padding: 2px;
-moz-padding-start: 4px;
-moz-padding-end: 0;
padding: 5px 0;
white-space: nowrap;
vertical-align: text-top;
}
/* Take away these two :visited rules to get a core dumper */
@ -77,11 +69,6 @@
text-decoration: none;
}
.helplink-container {
position: relative;
top: 2px;
}
.helplink {
display: block;
height: 14px;
@ -90,27 +77,27 @@
-moz-padding-start: 14px;
background-image: url("chrome://browser/skin/devtools/goto-mdn.png");
-moz-margin-end: 2px;
cursor: pointer;
}
.property-header:not(:hover) > .helplink-container {
.property-view:not(:hover) > .helplink-container {
visibility: hidden;
}
.unmatchedSelectorTable {
-moz-margin-start: 15px;
}
.rulelink {
color: -moz-dialogtext;
-moz-margin-start: 12px;
padding: 0;
}
.expander {
-moz-appearance: treetwisty;
width: 12px;
height: 12px;
padding-top: 12px;
-moz-margin-start: 5px;
-moz-margin-end: 5px;
display: inline-block;
vertical-align: middle;
}
.expander[open] {
@ -125,25 +112,25 @@
visibility: hidden;
}
.expandable > .match {
.expandable > .property-header > .match {
visibility: visible;
}
.only-unmatched {
-moz-margin-start: 0;
}
.property-name {
font-size: 12px;
color: -moz-FieldText;
width: 220px;
display: inline-block;
}
.property-value {
padding: 0;
font-size: 10px;
color: grey;
vertical-align: text-top;
width: 100%;
}
.property-view-hidden {
.property-view-hidden,
.property-content-hidden {
display: none;
}
@ -155,7 +142,8 @@
/* This rule is necessary because Templater.jsm breaks LTR TDs in RTL docs */
.rule-text {
direction: ltr;
-moz-padding-start: 15px;
padding: 0;
-moz-padding-start: 20px;
}
.bestmatch {
@ -167,15 +155,13 @@
.parentmatch {
color: #666;
}
.unmatched {
color: brown;
}
#propertyContainer {
display: -moz-box;
-moz-box-orient: vertical;
-moz-box-flex: 1;
overflow-y: auto;
border-collapse: collapse;
}
.darkrow {
@ -191,7 +177,6 @@
.headerControls {
color: -moz-dialogtext;
background-color: -moz-dialog;
padding-top: 5px;
}
.onlyuserstyles {
@ -199,14 +184,6 @@
font-size: 11px;
}
.searchfield {
-moz-margin-start: 10px;
}
.styleinspector-legend {
-moz-margin-start: 12px;
}
#footer {
border-top: 1px solid -moz-dialog;
}

View File

@ -2802,6 +2802,7 @@ panel[dimmed="true"] {
.inspector-breadcrumbs-button {
-moz-appearance: none;
background-color: transparent;
border-style: solid;
border-width: 2px 13px;
outline: none;
color: hsl(210,30%,85%);
@ -2833,57 +2834,57 @@ panel[dimmed="true"] {
}
.inspector-breadcrumbs-button {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:not([checked]),
.inspector-breadcrumbs-button:not([checked]):hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-pressed.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked] {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked][siblings-menu-open],
.inspector-breadcrumbs-button[checked]:hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle-selected-pressed.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type:not([checked]),
.inspector-breadcrumbs-button:first-of-type:not([checked]):hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-pressed.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type[checked] {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type[checked],
.inspector-breadcrumbs-button:first-of-type[checked]:hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-start-selected-pressed.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type:not([checked]),
.inspector-breadcrumbs-button:last-of-type:not([checked]):hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-pressed.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type[checked] {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type[checked],
.inspector-breadcrumbs-button:last-of-type[checked]:hover:active {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-end-selected-pressed.png") 2 13 2 13 fill stretch;
}
/* Highlighter toolbar - breadcrumbs - RTL */
@ -2893,55 +2894,55 @@ panel[dimmed="true"] {
}
.inspector-breadcrumbs-button:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:not([checked]):-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:not([checked]):hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-pressed.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked]:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[checked][siblings-menu-open]:-moz-locale-dir(rtl),
.inspector-breadcrumbs-button[checked]:hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-middle-selected-pressed.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type:not([checked]):-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:first-of-type:not([checked]):hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-pressed.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:first-of-type[checked]:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:first-of-type[checked]:-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:first-of-type[checked]:hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-start-selected-pressed.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type:not([checked]):-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:last-of-type:not([checked]):hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-pressed.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button:last-of-type[checked]:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected.png") 2 13 2 13 fill stretch;
}
.inspector-breadcrumbs-button[siblings-menu-open]:last-of-type[checked]:-moz-locale-dir(rtl),
.inspector-breadcrumbs-button:last-of-type[checked]:hover:active:-moz-locale-dir(rtl) {
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected-pressed.png") 2 13 2 13 stretch;
-moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/rtl-end-selected-pressed.png") 2 13 2 13 fill stretch;
}

View File

@ -50,17 +50,9 @@
}
.property-header {
padding: 4px;
-moz-padding-start: 0;
-moz-padding-end: 5px;
}
.rule-unmatched {
cursor: pointer;
padding: 2px;
-moz-padding-start: 4px;
-moz-padding-end: 0;
padding: 5px 0;
white-space: nowrap;
vertical-align: text-top;
}
/* Take away these two :visited rules to get a core dumper */
@ -76,11 +68,6 @@
text-decoration: none;
}
.helplink-container {
position: relative;
top: 2px;
}
.helplink {
display: block;
height: 14px;
@ -89,19 +76,16 @@
-moz-padding-start: 14px;
background-image: url("chrome://browser/skin/devtools/goto-mdn.png");
-moz-margin-end: 2px;
cursor: pointer;
}
.property-header:not(:hover) > .helplink-container {
.property-view:not(:hover) > .helplink-container {
visibility: hidden;
}
.unmatchedSelectorTable {
-moz-margin-start: 15px;
}
.rulelink {
color: -moz-dialogtext;
-moz-margin-start: 12px;
padding: 0;
}
.expander {
@ -110,6 +94,8 @@
-moz-margin-start: 5px;
-moz-margin-end: 5px;
background: url("chrome://global/skin/tree/twisty-clsd.png") center center no-repeat;
display: inline-block;
vertical-align: middle;
}
.expander[open] {
@ -124,25 +110,25 @@
visibility: hidden;
}
.expandable > .match {
.expandable > .property-header > .match {
visibility: visible;
}
.only-unmatched {
-moz-margin-start: 0;
}
.property-name {
font-size: 12px;
color: -moz-FieldText;
width: 220px;
display: inline-block;
}
.property-value {
padding: 0;
font-size: 10px;
color: grey;
vertical-align: text-top;
width: 100%;
}
.property-view-hidden {
.property-view-hidden,
.property-content-hidden {
display: none;
}
@ -154,7 +140,8 @@
/* This rule is necessary because Templater.jsm breaks LTR TDs in RTL docs */
.rule-text {
direction: ltr;
-moz-padding-start: 15px;
padding: 0;
-moz-padding-start: 20px;
}
.bestmatch {
@ -166,15 +153,13 @@
.parentmatch {
color: #666;
}
.unmatched {
color: brown;
}
#propertyContainer {
display: -moz-box;
-moz-box-orient: vertical;
-moz-box-flex: 1;
overflow-y: auto;
border-collapse: collapse;
}
.darkrow {
@ -190,7 +175,6 @@
.headerControls {
color: -moz-dialogtext;
background-color: -moz-dialog;
padding-top: 5px;
}
.onlyuserstyles {
@ -198,14 +182,6 @@
font-size: 11px;
}
.searchfield {
-moz-margin-start: 10px;
}
.styleinspector-legend {
-moz-margin-start: 12px;
}
#footer {
border-top: 1px solid -moz-dialog;
}

View File

@ -218,17 +218,19 @@ WifiGeoPositionProvider.prototype = {
if (accessPoints) {
providerUrl = providerUrl + accessPoints.sort(sort).map(encode).join("");
// max length is 2k. make sure we are under that
let x = providerUrl.length - 2000;
if (x >= 0) {
// we need to trim
let doomed = providerUrl.lastIndexOf("&", 2000);
LOG("Doomed:"+doomed);
providerUrl = providerUrl.substring(0, doomed);
}
}
providerUrl = encodeURI(providerUrl);
// max length is 2k. make sure we are under that
let x = providerUrl.length - 2000;
if (x >= 0) {
// we need to trim
let doomed = providerUrl.lastIndexOf("&", 2000);
LOG("Doomed:"+doomed);
providerUrl = providerUrl.substring(0, doomed);
}
LOG("************************************* Sending request:\n" + providerUrl + "\n");
// send our request to a wifi geolocation network provider: