Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/ui.js

Issue 9169140: Bug 798567 removed nsIDOMCSSValueList interface (Closed)
Patch Set: Created Jan. 14, 2013, 12:52 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « .hgsubstate ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of the Adblock Plus, 2 * This file is part of the Adblock Plus,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 if (data && !data[1].filter) 1712 if (data && !data[1].filter)
1713 addMenuItem(data); 1713 addMenuItem(data);
1714 } 1714 }
1715 1715
1716 // Look for a background image 1716 // Look for a background image
1717 if (!hadImage) 1717 if (!hadImage)
1718 { 1718 {
1719 function extractImageURL(computedStyle, property) 1719 function extractImageURL(computedStyle, property)
1720 { 1720 {
1721 let value = computedStyle.getPropertyCSSValue(property); 1721 let value = computedStyle.getPropertyCSSValue(property);
1722 if (value instanceof Ci.nsIDOMCSSValueList && value.length >= 1) 1722 // CSSValueList
1723 if ("length" in value && value.length >= 1)
Thomas Greiner 2013/01/14 14:16:24 What about using |value instanceof CSSValueList| i
Wladimir Palant 2013/01/14 14:46:54 CSSValueList won't be defined in this context - it
1723 value = value[0]; 1724 value = value[0];
1724 if (value instanceof Ci.nsIDOMCSSPrimitiveValue && value.primitiveType = = Ci.nsIDOMCSSPrimitiveValue.CSS_URI) 1725 // CSSValuePrimitiveType
1726 if ("primitiveType" in value && value.primitiveType == value.CSS_URI)
Thomas Greiner 2013/01/14 14:16:24 What about using |value instanceof CSSPrimitiveVal
Wladimir Palant 2013/01/14 14:46:54 Same as above.
1725 return Utils.unwrapURL(value.getStringValue()).spec; 1727 return Utils.unwrapURL(value.getStringValue()).spec;
1726 1728
1727 return null; 1729 return null;
1728 } 1730 }
1729 1731
1730 let node = target; 1732 let node = target;
1731 while (node) 1733 while (node)
1732 { 1734 {
1733 if (node.nodeType == Ci.nsIDOMNode.ELEMENT_NODE) 1735 if (node.nodeType == Ci.nsIDOMNode.ELEMENT_NODE)
1734 { 1736 {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1928 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], 1930 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)],
1929 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] 1931 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)]
1930 ]; 1932 ];
1931 1933
1932 onShutdown.add(function() 1934 onShutdown.add(function()
1933 { 1935 {
1934 for (let window in UI.applicationWindows) 1936 for (let window in UI.applicationWindows)
1935 if (UI.isBottombarOpen(window)) 1937 if (UI.isBottombarOpen(window))
1936 UI.toggleBottombar(window); 1938 UI.toggleBottombar(window);
1937 }); 1939 });
OLDNEW
« no previous file with comments | « .hgsubstate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld