Merge autoland to central, a=merge

MozReview-Commit-ID: 9BfFPDy1vO7

--HG--
rename : browser/extensions/onboarding/content/img/icons_search-colored.svg => browser/extensions/onboarding/content/img/icons_singlesearch-colored.svg
rename : browser/extensions/onboarding/content/img/icons_search.svg => browser/extensions/onboarding/content/img/icons_singlesearch.svg
This commit is contained in:
Wes Kocher 2017-08-14 17:28:19 -07:00
Родитель 522da33dcf 8b9c63db85
Коммит 214677ea41
237 изменённых файлов: 2396 добавлений и 1770 удалений

Просмотреть файл

@ -17,6 +17,7 @@
class nsFrameSelection;
class nsRange;
class nsIEditor;
class nsIWidget;
namespace mozilla {

Просмотреть файл

@ -148,13 +148,19 @@ var TabsInTitlebar = {
document.documentElement.setAttribute("tabsintitlebar", "true");
updateTitlebarDisplay();
// Reset the custom titlebar height if the menubar is shown,
// because we will want to calculate its original height.
if (AppConstants.isPlatformAndVersionAtLeast("win", "10.0") &&
(menubar.getAttribute("inactive") != "true" ||
menubar.getAttribute("autohide") != "true")) {
$("titlebar-buttonbox").style.removeProperty("height");
}
// Try to avoid reflows in this code by calculating dimensions first and
// then later set the properties affecting layout together in a batch.
// Get the full height of the tabs toolbar:
let tabsToolbar = $("TabsToolbar");
let tabsStyles = window.getComputedStyle(tabsToolbar);
let fullTabsHeight = rect(tabsToolbar).height + verticalMargins(tabsStyles);
// Get the height of the tabs toolbar:
let tabsHeight = rect($("TabsToolbar")).height;
// Buttons first:
let captionButtonsBoxWidth = rect($("titlebar-buttonbox-container")).width;
@ -176,12 +182,12 @@ var TabsInTitlebar = {
// Begin setting CSS properties which will cause a reflow
// On Windows 10, adjust the window controls to span the entire
// tab strip height if we're not showing a menu bar.
if (AppConstants.isPlatformAndVersionAtLeast("win", "10.0")) {
if (!menuHeight && window.windowState == window.STATE_MAXIMIZED) {
titlebarContentHeight = Math.max(titlebarContentHeight, fullTabsHeight);
if (!menuHeight) {
titlebarContentHeight = tabsHeight;
$("titlebar-buttonbox").style.height = titlebarContentHeight + "px";
} else {
$("titlebar-buttonbox").style.removeProperty("height");
}
}
@ -214,7 +220,7 @@ var TabsInTitlebar = {
// Next, we calculate how much we need to stretch the titlebar down to
// go all the way to the bottom of the tab strip, if necessary.
let tabAndMenuHeight = fullTabsHeight + fullMenuHeight;
let tabAndMenuHeight = tabsHeight + fullMenuHeight;
if (tabAndMenuHeight > titlebarContentHeight) {
// We need to increase the titlebar content's outer height (ie including margins)

Просмотреть файл

@ -89,16 +89,6 @@ if (Services.appinfo.OS == "WINNT" || Services.appinfo.OS == "Darwin") {
],
times: 4, // This number should only ever go down - never up.
},
{
stack: [
"verticalMargins@chrome://browser/content/browser-tabsintitlebar.js",
"_update@chrome://browser/content/browser-tabsintitlebar.js",
"init@chrome://browser/content/browser-tabsintitlebar.js",
"handleEvent@chrome://browser/content/tabbrowser.xml",
],
times: 2, // This number should only ever go down - never up.
}
);
}

Просмотреть файл

@ -61,6 +61,16 @@ async function openAndCheckCustomizationUIMenu(target) {
menu.hidePopup();
}
// Ensure that we can run touch events properly for windows [10]
add_task(async function setup() {
let isWindows = AppConstants.isPlatformAndVersionAtLeast("win", "10.0");
await SpecialPowers.pushPrefEnv({
set: [
["apz.test.fails_with_native_injection", isWindows]
]
});
});
// Test main ("hamburger") menu.
add_task(async function test_main_menu_touch() {
let mainMenu = document.getElementById("appMenu-popup");
@ -70,9 +80,12 @@ add_task(async function test_main_menu_touch() {
// Test the page action menu.
add_task(async function test_page_action_panel_touch() {
let pageActionPanel = document.getElementById("page-action-panel");
let target = document.getElementById("urlbar-page-action-button");
await openAndCheckMenu(pageActionPanel, target);
// The page action menu only appears on a web page.
await BrowserTestUtils.withNewTab("https://example.com", async function() {
let pageActionPanel = document.getElementById("pageActionPanel");
let target = document.getElementById("pageActionButton");
await openAndCheckMenu(pageActionPanel, target);
});
});
// Test the customizationUI panel, which is used for various menus

Просмотреть файл

@ -549,7 +549,7 @@
<hbox pack="end">
<button id="locationSettingsButton"
class="accessory-button"
label="&permissionSettingsButton.label;"
label="&permissionSettingsButton2.label;"
accesskey="&locationSettingsButton.accesskey;"
searchkeywords="&removepermission2.label;
&removeallpermissions2.label;
@ -567,7 +567,7 @@
<hbox pack="end">
<button id="cameraSettingsButton"
class="accessory-button"
label="&permissionSettingsButton.label;"
label="&permissionSettingsButton2.label;"
accesskey="&cameraSettingsButton.accesskey;"
searchkeywords="&removepermission2.label;
&removeallpermissions2.label;
@ -585,7 +585,7 @@
<hbox pack="end">
<button id="microphoneSettingsButton"
class="accessory-button"
label="&permissionSettingsButton.label;"
label="&permissionSettingsButton2.label;"
accesskey="&microphoneSettingsButton.accesskey;"
searchkeywords="&removepermission2.label;
&removeallpermissions2.label;
@ -605,7 +605,7 @@
<hbox pack="end">
<button id="notificationSettingsButton"
class="accessory-button"
label="&permissionSettingsButton.label;"
label="&permissionSettingsButton2.label;"
accesskey="&notificationSettingsButton.accesskey;"
searchkeywords="&removepermission2.label;
&removeallpermissions2.label;

Просмотреть файл

@ -12,3 +12,4 @@ scheme = https
[test_hide_gamepad_info.html]
support-files = test_hide_gamepad_info_iframe.html
[test_speech_synthesis.html]
[test_bug1382499_touch_api.html]

Просмотреть файл

@ -0,0 +1,48 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script>
/* global SimpleTest SpecialPowers synthesizeTouch */
SimpleTest.waitForExplicitFinish();
function promiseEvent(target, eventName) {
return new Promise(resolve => {
target.addEventListener(eventName, resolve, {once: true});
});
}
function promiseTouchEvent(target, type, offsetX, offsetY, params) {
let touchEventPromise = promiseEvent(target, type);
params.type = type;
synthesizeTouch(target, offsetX, offsetY, params);
return touchEventPromise;
}
document.addEventListener("DOMContentLoaded", async () => {
const target0 = document.getElementById("target0");
const touchParams = {force: 1.0, angle: 1.0, rx: 2, ry: 3};
await SpecialPowers.pushPrefEnv({set: [["dom.w3c_touch_events.enabled", 1]]});
for (let resist of [false, true]) {
await SpecialPowers.pushPrefEnv({set: [["privacy.resistFingerprinting", resist]]});
info("starting test with fingerprinting resistance " + (resist ? "on" : "off"));
let touchEvent = await promiseTouchEvent(target0, "touchstart", 5, 5, touchParams);
info("touch event received");
let touch = touchEvent.touches[0];
if (resist) {
is(touch.screenX, touch.clientX, "touch.screenX should be the same as touch.clientX");
is(touch.screenY, touch.clientY, "touch.screenY should be the same as touch.clientY");
// radiusX/radiusY may differ from the original rx/ry because of AppUnitsPerCSSPixel and AppUnitsPerDevPixel.
// So only check if the values are spoofed.
is(touch.radiusX, 0, "touch.radiusX");
is(touch.radiusY, 0, "touch.radiusY");
}
is(touch.force, resist ? 0.0 : touchParams.force, "touch.force");
is(touch.rotationAngle, resist ? 0 : touchParams.angle, "touch.rotationAngle");
}
SimpleTest.finish();
});
</script>
<div id="target0">target 0</div>

Просмотреть файл

@ -27,6 +27,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "FormAutofillHandler",
"resource://formautofill/FormAutofillHandler.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FormLikeFactory",
"resource://gre/modules/FormLikeFactory.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "InsecurePasswordUtils",
"resource://gre/modules/InsecurePasswordUtils.jsm");
const formFillController = Cc["@mozilla.org/satchel/form-fill-controller;1"]
.getService(Ci.nsIFormFillController);
@ -100,7 +102,7 @@ AutofillProfileAutoCompleteSearch.prototype = {
let isAddressField = FormAutofillUtils.isAddressField(info.fieldName);
let handler = FormAutofillContent.getFormHandler(focusedInput);
let allFieldNames = handler.allFieldNames;
let filledRecordGUID = isAddressField ? handler.address.filledRecordGUID : handler.creditCards.filledRecordGUID;
let filledRecordGUID = isAddressField ? handler.address.filledRecordGUID : handler.creditCard.filledRecordGUID;
// Fallback to form-history if ...
// - no profile can fill the currently-focused input.
@ -137,11 +139,13 @@ AutofillProfileAutoCompleteSearch.prototype = {
adaptedRecords,
{});
} else {
let isSecure = InsecurePasswordUtils.isFormSecure(handler.form);
result = new CreditCardResult(searchString,
info.fieldName,
allFieldNames,
adaptedRecords,
{});
{isSecure});
}
listener.onSearchResult(this, result);
ProfileAutocomplete.setProfileAutoCompleteResult(result);

Просмотреть файл

@ -82,6 +82,7 @@ FormAutofillParent.prototype = {
Services.ppmm.addMessageListener("FormAutofill:InitStorage", this);
Services.ppmm.addMessageListener("FormAutofill:GetRecords", this);
Services.ppmm.addMessageListener("FormAutofill:SaveAddress", this);
Services.ppmm.addMessageListener("FormAutofill:SaveCreditCard", this);
Services.ppmm.addMessageListener("FormAutofill:RemoveAddresses", this);
Services.ppmm.addMessageListener("FormAutofill:OpenPreferences", this);
Services.mm.addMessageListener("FormAutofill:OnFormSubmit", this);
@ -193,6 +194,10 @@ FormAutofillParent.prototype = {
}
break;
}
case "FormAutofill:SaveCreditCard": {
this.profileStorage.creditCards.add(data.creditcard);
break;
}
case "FormAutofill:RemoveAddresses": {
data.guids.forEach(guid => this.profileStorage.addresses.remove(guid));
break;
@ -219,6 +224,7 @@ FormAutofillParent.prototype = {
Services.ppmm.removeMessageListener("FormAutofill:InitStorage", this);
Services.ppmm.removeMessageListener("FormAutofill:GetRecords", this);
Services.ppmm.removeMessageListener("FormAutofill:SaveAddress", this);
Services.ppmm.removeMessageListener("FormAutofill:SaveCreditCard", this);
Services.ppmm.removeMessageListener("FormAutofill:RemoveAddresses", this);
Services.obs.removeObserver(this, "advanced-pane-loaded");
Services.prefs.removeObserver(ENABLED_PREF, this);

Просмотреть файл

@ -433,3 +433,7 @@ XPCOMUtils.defineLazyGetter(this.FormAutofillUtils, "DEFAULT_COUNTRY_CODE", () =
this.log = null;
this.FormAutofillUtils.defineLazyLogGetter(this, this.EXPORTED_SYMBOLS[0]);
XPCOMUtils.defineLazyGetter(FormAutofillUtils, "stringBundle", function() {
return Services.strings.createBundle("chrome://formautofill/locale/formautofill.properties");
});

Просмотреть файл

@ -8,14 +8,23 @@ this.EXPORTED_SYMBOLS = ["AddressResult", "CreditCardResult"]; /* exported Addre
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://formautofill/FormAutofillUtils.jsm");
XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
return Services.strings.createBundle("chrome://branding/locale/brand.properties");
});
XPCOMUtils.defineLazyPreferenceGetter(this, "insecureWarningEnabled", "security.insecure_field_warning.contextual.enabled");
this.log = null;
FormAutofillUtils.defineLazyLogGetter(this, this.EXPORTED_SYMBOLS[0]);
class ProfileAutoCompleteResult {
constructor(searchString, focusedFieldName, allFieldNames, matchingProfiles, {resultCode = null}) {
constructor(searchString, focusedFieldName, allFieldNames, matchingProfiles, {
resultCode = null,
isSecure = true,
}) {
log.debug("Constructing new ProfileAutoCompleteResult:", [...arguments]);
// nsISupports
@ -33,6 +42,8 @@ class ProfileAutoCompleteResult {
this.defaultIndex = 0;
// The reason the search failed
this.errorDescription = "";
// The value used to determine whether the form is secure or not.
this._isSecure = isSecure;
// The result code of this result object.
if (resultCode) {
@ -147,17 +158,6 @@ class ProfileAutoCompleteResult {
class AddressResult extends ProfileAutoCompleteResult {
constructor(...args) {
super(...args);
// Add an empty result entry for footer. Its content will come from
// the footer binding, so don't assign any value to it.
// The additional properties: categories and focusedCategory are required of
// the popup to generate autofill hint on the footer.
this._popupLabels.push({
primary: "",
secondary: "",
categories: FormAutofillUtils.getCategoriesFromFieldNames(this._allFieldNames),
focusedCategory: FormAutofillUtils.getCategoryFromFieldName(this._focusedFieldName),
});
}
_getSecondaryLabel(focusedFieldName, allFieldNames, profile) {
@ -233,7 +233,7 @@ class AddressResult extends ProfileAutoCompleteResult {
_generateLabels(focusedFieldName, allFieldNames, profiles) {
// Skip results without a primary label.
return profiles.filter(profile => {
let labels = profiles.filter(profile => {
return !!profile[focusedFieldName];
}).map(profile => {
let primaryLabel = profile[focusedFieldName];
@ -248,17 +248,24 @@ class AddressResult extends ProfileAutoCompleteResult {
profile),
};
});
// Add an empty result entry for footer. Its content will come from
// the footer binding, so don't assign any value to it.
// The additional properties: categories and focusedCategory are required of
// the popup to generate autofill hint on the footer.
labels.push({
primary: "",
secondary: "",
categories: FormAutofillUtils.getCategoriesFromFieldNames(this._allFieldNames),
focusedCategory: FormAutofillUtils.getCategoryFromFieldName(this._focusedFieldName),
});
return labels;
}
}
class CreditCardResult extends ProfileAutoCompleteResult {
constructor(...args) {
super(...args);
// Add an empty result entry for footer.
this._popupLabels.push({primary: "", secondary: ""});
}
_getSecondaryLabel(focusedFieldName, allFieldNames, profile) {
@ -307,8 +314,17 @@ class CreditCardResult extends ProfileAutoCompleteResult {
}
_generateLabels(focusedFieldName, allFieldNames, profiles) {
if (!this._isSecure) {
if (!insecureWarningEnabled) {
return [];
}
let brandName = gBrandBundle.GetStringFromName("brandShortName");
return [FormAutofillUtils.stringBundle.formatStringFromName("insecureFieldWarningDescription", [brandName], 1)];
}
// Skip results without a primary label.
return profiles.filter(profile => {
let labels = profiles.filter(profile => {
return !!profile[focusedFieldName];
}).map(profile => {
return {
@ -318,13 +334,40 @@ class CreditCardResult extends ProfileAutoCompleteResult {
profile),
};
});
// Add an empty result entry for footer.
labels.push({primary: "", secondary: ""});
return labels;
}
// Always return empty string for credit card result. Since the decryption might
// be required of users' input, we have to to suppress AutoCompleteController
// be required of users' input, we have to suppress AutoCompleteController
// from filling encrypted data directly.
getValueAt(index) {
this._checkIndexBounds(index);
return "";
}
getLabelAt(index) {
this._checkIndexBounds(index);
let label = this._popupLabels[index];
if (typeof label == "string") {
return label;
}
return JSON.stringify(label);
}
getStyleAt(index) {
this._checkIndexBounds(index);
if (!this._isSecure && insecureWarningEnabled) {
return "autofill-insecureWarning";
}
if (index == this.matchCount - 1) {
return "autofill-footer";
}
return "autofill-profile";
}
}

Просмотреть файл

@ -3,7 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#PopupAutoComplete > richlistbox > richlistitem[originaltype="autofill-profile"],
#PopupAutoComplete > richlistbox > richlistitem[originaltype="autofill-footer"] {
#PopupAutoComplete > richlistbox > richlistitem[originaltype="autofill-footer"],
#PopupAutoComplete > richlistbox > richlistitem[originaltype="autofill-insecureWarning"] {
display: block;
margin: 0;
padding: 0;
@ -19,13 +20,22 @@
-moz-binding: url("chrome://formautofill/content/formautofill.xml#autocomplete-profile-listitem-footer");
}
#PopupAutoComplete > richlistbox > richlistitem[originaltype="autofill-insecureWarning"] {
-moz-binding: url("chrome://formautofill/content/formautofill.xml#autocomplete-creditcard-insecure-field");
}
/* Treat @collpased="true" as display: none similar to how it is for XUL elements.
* https://developer.mozilla.org/en-US/docs/Web/CSS/visibility#Values */
#PopupAutoComplete > richlistbox > richlistitem[originaltype="autofill-profile"][collapsed="true"],
#PopupAutoComplete > richlistbox > richlistitem[originaltype="autofill-footer"][collapsed="true"] {
#PopupAutoComplete > richlistbox > richlistitem[originaltype="autofill-footer"][collapsed="true"],
#PopupAutoComplete > richlistbox > richlistitem[originaltype="autofill-insecureWarning"][collapsed="true"] {
display: none;
}
#PopupAutoComplete[firstresultstyle="autofill-profile"] {
min-width: 150px !important;
}
#PopupAutoComplete[firstresultstyle="autofill-insecureWarning"] {
min-width: 200px !important;
}

Просмотреть файл

@ -58,6 +58,10 @@
<body></body>
</method>
<method name="handleOverUnderflow">
<body></body>
</method>
<method name="_adjustAutofillItemLayout">
<body>
<![CDATA[
@ -276,4 +280,43 @@
</implementation>
</binding>
<binding id="autocomplete-creditcard-insecure-field" extends="chrome://formautofill/content/formautofill.xml#autocomplete-profile-listitem-base">
<xbl:content xmlns="http://www.w3.org/1999/xhtml">
<div anonid="autofill-item-box" class="autofill-insecure-item">
</div>
</xbl:content>
<implementation implements="nsIDOMXULSelectControlItemElement">
<constructor>
<![CDATA[
this._itemBox = document.getAnonymousElementByAttribute(
this, "anonid", "autofill-item-box"
);
this._adjustAcItem();
]]>
</constructor>
<property name="selected" onget="return this.getAttribute('selected') == 'true';">
<setter><![CDATA[
// Make this item unselectable since we see this item as a pure message.
return false;
]]></setter>
</property>
<method name="_adjustAcItem">
<body>
<![CDATA[
this._adjustAutofillItemLayout();
this.setAttribute("formautofillattached", "true");
let value = this.getAttribute("ac-value");
this._itemBox.textContent = value;
]]>
</body>
</method>
</implementation>
</binding>
</bindings>

Просмотреть файл

@ -56,3 +56,5 @@ email = Email
cancel = Cancel
save = Save
countryWarningMessage = Autofill is currently available only for US addresses
insecureFieldWarningDescription = %S has detected an insecure site. Credit card autofill is temporarily disabled

Просмотреть файл

@ -14,6 +14,11 @@ xul|richlistitem[originaltype="autofill-footer"][selected="true"] > .autofill-it
background-color: #DCDCDE;
}
xul|richlistitem[originaltype="autofill-insecureWarning"] {
border-bottom: 1px solid var(--panel-separator-color);
background-color: var(--arrowpanel-dimmed);
}
.autofill-item-box {
--item-padding-vertical: 6px;
--item-padding-horizontal: 10px;
@ -109,3 +114,25 @@ xul|richlistitem[originaltype="autofill-footer"][selected="true"] > .autofill-it
.autofill-footer[no-warning="true"] > .autofill-warning {
display: none;
}
.autofill-insecure-item {
box-sizing: border-box;
padding: 4px 0;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
color: GrayText;
}
.autofill-insecure-item::before {
display: block;
margin-inline-start: 4px;
margin-inline-end: 8px;
content: "";
width: 16px;
height: 16px;
background-image: url(chrome://browser/skin/connection-mixed-active-loaded.svg);
-moz-context-properties: fill;
fill: GrayText;
}

Просмотреть файл

@ -3,6 +3,7 @@ head = head.js
support-files =
../fixtures/autocomplete_basic.html
../fixtures/autocomplete_creditcard_basic.html
[browser_autocomplete_footer.js]
[browser_autocomplete_marked_back_forward.js]
@ -10,7 +11,8 @@ support-files =
[browser_check_installed.js]
[browser_editAddressDialog.js]
[browser_first_time_use_doorhanger.js]
[browser_privacyPreferences.js]
[browser_insecure_form.js]
[browser_manageAddressesDialog.js]
[browser_privacyPreferences.js]
[browser_submission_in_private_mode.js]
[browser_update_doorhanger.js]

Просмотреть файл

@ -21,7 +21,7 @@ add_task(async function setup_storage() {
add_task(async function test_click_on_footer() {
await BrowserTestUtils.withNewTab({gBrowser, url: URL}, async function(browser) {
const {autoCompletePopup, autoCompletePopup: {richlistbox: itemsBox}} = browser;
const {autoCompletePopup: {richlistbox: itemsBox}} = browser;
await openPopupOn(browser, "#organization");
// Click on the footer
@ -31,17 +31,13 @@ add_task(async function test_click_on_footer() {
await BrowserTestUtils.removeTab(await prefTabPromise);
ok(true, "Tab: preferences#privacy was successfully opened by clicking on the footer");
// Ensure the popup is closed before entering the next test.
await ContentTask.spawn(browser, {}, async function() {
content.document.getElementById("organization").blur();
});
await BrowserTestUtils.waitForCondition(() => !autoCompletePopup.popupOpen);
await closePopup(browser);
});
});
add_task(async function test_press_enter_on_footer() {
await BrowserTestUtils.withNewTab({gBrowser, url: URL}, async function(browser) {
const {autoCompletePopup, autoCompletePopup: {richlistbox: itemsBox}} = browser;
const {autoCompletePopup: {richlistbox: itemsBox}} = browser;
await openPopupOn(browser, "#organization");
// Navigate to the footer and press enter.
@ -54,17 +50,13 @@ add_task(async function test_press_enter_on_footer() {
await BrowserTestUtils.removeTab(await prefTabPromise);
ok(true, "Tab: preferences#privacy was successfully opened by pressing enter on the footer");
// Ensure the popup is closed before entering the next test.
await ContentTask.spawn(browser, {}, async function() {
content.document.getElementById("organization").blur();
});
await BrowserTestUtils.waitForCondition(() => !autoCompletePopup.popupOpen);
await closePopup(browser);
});
});
add_task(async function test_phishing_warning() {
await BrowserTestUtils.withNewTab({gBrowser, url: URL}, async function(browser) {
const {autoCompletePopup, autoCompletePopup: {richlistbox: itemsBox}} = browser;
const {autoCompletePopup: {richlistbox: itemsBox}} = browser;
await openPopupOn(browser, "#street-address");
const warningBox = itemsBox.querySelector(".autocomplete-richlistitem:last-child")._warningTextBox;
@ -78,10 +70,6 @@ add_task(async function test_phishing_warning() {
await BrowserTestUtils.synthesizeKey("VK_DOWN", {}, browser);
await expectWarningText(browser, "Also autofills company, phone, email");
// Ensure the popup is closed before entering the next test.
await ContentTask.spawn(browser, {}, async function() {
content.document.getElementById("street-address").blur();
});
await BrowserTestUtils.waitForCondition(() => !autoCompletePopup.popupOpen);
await closePopup(browser);
});
});

Просмотреть файл

@ -51,11 +51,6 @@ add_task(async function test_back_forward() {
await openPopupOn(browser, "#street-address");
checkPopup(autoCompletePopup);
// Ensure the popup is closed before entering the next test.
await ContentTask.spawn(browser, {}, async function() {
content.document.getElementById("street-address").blur();
});
await BrowserTestUtils.waitForCondition(() => !autoCompletePopup.popupOpen,
"popup should have closed");
await closePopup(browser);
});
});

Просмотреть файл

@ -43,12 +43,7 @@ add_task(async function test_detach_tab_marked() {
await openPopupOn(newBrowser, "#street-address");
checkPopup(newAutoCompletePopup);
// Ensure the popup is closed before entering the next test.
await ContentTask.spawn(newBrowser, {}, async function() {
content.document.getElementById("street-address").blur();
});
await BrowserTestUtils.waitForCondition(() => !newAutoCompletePopup.popupOpen,
"popup should have closed");
await closePopup(newBrowser);
await BrowserTestUtils.closeWindow(newWin);
});
});

Просмотреть файл

@ -0,0 +1,94 @@
"use strict";
const TEST_URL_PATH_CC = "://example.org/browser/browser/extensions/formautofill/test/browser/autocomplete_creditcard_basic.html";
const TEST_URL_PATH = "://example.org/browser/browser/extensions/formautofill/test/browser/autocomplete_basic.html";
add_task(async function setup_storage() {
await saveAddress(TEST_ADDRESS_1);
await saveAddress(TEST_ADDRESS_2);
await saveAddress(TEST_ADDRESS_3);
await saveCreditCard(TEST_CREDIT_CARD_1);
await saveCreditCard(TEST_CREDIT_CARD_2);
await saveCreditCard(TEST_CREDIT_CARD_3);
});
add_task(async function test_insecure_form() {
async function runTest({urlPath, protocol, focusInput, expectedType, expectedResultLength}) {
await BrowserTestUtils.withNewTab({gBrowser, url: protocol + urlPath}, async function(browser) {
await openPopupOn(browser, focusInput);
const items = getDisplayedPopupItems(browser);
is(items.length, expectedResultLength, `Should show correct amount of results in "${protocol}"`);
const firstItem = items[0];
is(firstItem.getAttribute("originaltype"), expectedType, `Item should attach with correct binding in "${protocol}"`);
await closePopup(browser);
});
}
const testSets = [{
urlPath: TEST_URL_PATH,
protocol: "https",
focusInput: "#organization",
expectedType: "autofill-profile",
expectedResultLength: 2,
}, {
urlPath: TEST_URL_PATH,
protocol: "http",
focusInput: "#organization",
expectedType: "autofill-profile",
expectedResultLength: 2,
}, {
urlPath: TEST_URL_PATH_CC,
protocol: "https",
focusInput: "#cc-name",
expectedType: "autofill-profile",
expectedResultLength: 3,
}, {
urlPath: TEST_URL_PATH_CC,
protocol: "http",
focusInput: "#cc-name",
expectedType: "autofill-insecureWarning", // insecure warning field
expectedResultLength: 1,
}];
await runTest(testSets[0]);
await runTest(testSets[1]);
await runTest(testSets[2]);
await runTest(testSets[3]);
});
add_task(async function test_click_on_insecure_warning() {
await BrowserTestUtils.withNewTab({gBrowser, url: "http" + TEST_URL_PATH_CC}, async function(browser) {
await openPopupOn(browser, "#cc-name");
const insecureItem = getDisplayedPopupItems(browser)[0];
await EventUtils.synthesizeMouseAtCenter(insecureItem, {});
// Check input's value after popup closed to ensure the completion of autofilling.
await expectPopupClose(browser);
const inputValue = await ContentTask.spawn(browser, {}, async function() {
return content.document.querySelector("#cc-name").value;
});
is(inputValue, "");
await closePopup(browser);
});
});
add_task(async function test_press_enter_on_insecure_warning() {
await BrowserTestUtils.withNewTab({gBrowser, url: "http" + TEST_URL_PATH_CC}, async function(browser) {
await openPopupOn(browser, "#cc-name");
await BrowserTestUtils.synthesizeKey("VK_DOWN", {}, browser);
await BrowserTestUtils.synthesizeKey("VK_RETURN", {}, browser);
// Check input's value after popup closed to ensure the completion of autofilling.
await expectPopupClose(browser);
const inputValue = await ContentTask.spawn(browser, {}, async function() {
return content.document.querySelector("#cc-name").value;
});
is(inputValue, "");
await closePopup(browser);
});
});

Просмотреть файл

@ -1,7 +1,9 @@
/* exported MANAGE_ADDRESSES_DIALOG_URL, EDIT_ADDRESS_DIALOG_URL, BASE_URL,
TEST_ADDRESS_1, TEST_ADDRESS_2, TEST_ADDRESS_3,
sleep, expectPopupOpen, openPopupOn, clickDoorhangerButton,
getAddresses, saveAddress, removeAddresses */
TEST_CREDIT_CARD_1, TEST_CREDIT_CARD_2, TEST_CREDIT_CARD_3,
sleep, expectPopupOpen, openPopupOn, expectPopupClose, closePopup, clickDoorhangerButton,
getAddresses, saveAddress, removeAddresses, saveCreditCard,
getDisplayedPopupItems */
"use strict";
@ -33,22 +35,51 @@ const TEST_ADDRESS_3 = {
"postal-code": "12345",
};
const TEST_CREDIT_CARD_1 = {
"cc-name": "John Doe",
"cc-number": "1234567812345678",
// "cc-number-encrypted": "",
"cc-exp-month": 4,
"cc-exp-year": 2017,
};
const TEST_CREDIT_CARD_2 = {
"cc-name": "Timothy Berners-Lee",
"cc-number": "1111222233334444",
"cc-exp-month": 12,
"cc-exp-year": 2022,
};
const TEST_CREDIT_CARD_3 = {
"cc-number": "9999888877776666",
"cc-exp-month": 1,
"cc-exp-year": 2000,
};
const MAIN_BUTTON_INDEX = 0;
const SECONDARY_BUTTON_INDEX = 1;
function getDisplayedPopupItems(browser, selector = ".autocomplete-richlistitem") {
const {autoCompletePopup: {richlistbox: itemsBox}} = browser;
const listItemElems = itemsBox.querySelectorAll(selector);
return [...listItemElems].filter(item => item.getAttribute("collapsed") != "true");
}
async function sleep(ms = 500) {
await new Promise(resolve => setTimeout(resolve, ms));
}
async function expectPopupOpen(browser) {
const {autoCompletePopup, autoCompletePopup: {richlistbox: itemsBox}} = browser;
const listItemElems = itemsBox.querySelectorAll(".autocomplete-richlistitem");
const {autoCompletePopup} = browser;
const listItemElems = getDisplayedPopupItems(browser);
await BrowserTestUtils.waitForCondition(() => autoCompletePopup.popupOpen,
"popup should be open");
await BrowserTestUtils.waitForCondition(() => {
return [...listItemElems].every(item => {
return (item.getAttribute("originaltype") == "autofill-profile" ||
item.getAttribute("originaltype") == "insecureWarning" ||
item.getAttribute("originaltype") == "autofill-footer") &&
item.hasAttribute("formautofillattached");
});
@ -58,14 +89,39 @@ async function expectPopupOpen(browser) {
async function openPopupOn(browser, selector) {
await SimpleTest.promiseFocus(browser);
/* eslint no-shadow: ["error", { "allow": ["selector"] }] */
await ContentTask.spawn(browser, {selector}, async function({selector}) {
content.document.querySelector(selector).focus();
const identified = await ContentTask.spawn(browser, {selector}, async function({selector}) {
const input = content.document.querySelector(selector);
const forms = content.document.getElementsByTagName("form");
const rootElement = [...forms].find(form => form.contains(input)) || content.document.body;
input.focus();
if (rootElement.hasAttribute("test-formautofill-identified")) {
return true;
}
rootElement.setAttribute("test-formautofill-identified", "true");
return false;
});
await sleep(2000);
// Wait 2 seconds for identifyAutofillFields if the form hasn't been identified yet.
if (!identified) {
await sleep(2000);
}
await BrowserTestUtils.synthesizeKey("VK_DOWN", {}, browser);
await expectPopupOpen(browser);
}
async function expectPopupClose(browser) {
await BrowserTestUtils.waitForCondition(() => !browser.autoCompletePopup.popupOpen,
"popup should have closed");
}
async function closePopup(browser) {
await ContentTask.spawn(browser, {}, async function() {
content.document.activeElement.blur();
});
await expectPopupClose(browser);
}
function getRecords(data) {
return new Promise(resolve => {
Services.cpmm.addMessageListener("FormAutofill:Records", function getResult(result) {
@ -85,6 +141,10 @@ function saveAddress(address) {
return TestUtils.topicObserved("formautofill-storage-changed");
}
function saveCreditCard(creditcard) {
Services.cpmm.sendAsyncMessage("FormAutofill:SaveCreditCard", {creditcard});
return TestUtils.topicObserved("formautofill-storage-changed");
}
function removeAddresses(guids) {
Services.cpmm.sendAsyncMessage("FormAutofill:RemoveAddresses", {guids});
return TestUtils.topicObserved("formautofill-storage-changed");

Просмотреть файл

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Form Autofill Credit Card Demo Page</title>
</head>
<body>
<h1>Form Autofill Credit Card Demo Page</h1>
<form id="form">
<p><label>Name: <input id="cc-name" autocomplete="cc-name"></label></p>
<p><label>Card Number: <input id="cc-number" autocomplete="cc-number"></label></p>
<p><label>Expiration month: <input id="cc-exp-month" autocomplete="cc-exp-month"></label></p>
<p><label>Expiration year: <input id="cc-exp-year" autocomplete="cc-exp-year"></label></p>
<p><label>CSC: <input id="cc-csc" autocomplete="cc-csc"></label></p>
<p>
<input type="submit" value="Submit">
<button type="reset">Reset</button>
</p>
</form>
</body>
</html>

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 66 KiB

После

Ширина:  |  Высота:  |  Размер: 75 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 91 KiB

После

Ширина:  |  Высота:  |  Размер: 76 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 16 KiB

После

Ширина:  |  Высота:  |  Размер: 13 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

После

Ширина:  |  Высота:  |  Размер: 65 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

После

Ширина:  |  Высота:  |  Размер: 38 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 51 KiB

После

Ширина:  |  Высота:  |  Размер: 45 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

После

Ширина:  |  Высота:  |  Размер: 9.6 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 24 KiB

После

Ширина:  |  Высота:  |  Размер: 26 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 8.1 KiB

После

Ширина:  |  Высота:  |  Размер: 6.2 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 5.6 KiB

После

Ширина:  |  Высота:  |  Размер: 5.0 KiB

Просмотреть файл

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 92 92"><style>.st0{fill:#0A84FF;}</style><path class="st0" d="M80.5 3.8h-69C5.1 3.8 0 8.9 0 15.3v57.5c0 6.4 5.1 11.5 11.5 11.5h28.8c3.2 0 5.8-2.6 5.8-5.8 0-3.2-2.6-5.8-5.8-5.8h-23c-3.2 0-5.8-2.6-5.8-5.8V32.5h69V44c0 3.2 2.6 5.8 5.8 5.8s5.8-2.6 5.8-5.8V15.2C92 8.9 86.9 3.8 80.5 3.8zm0 23h-69V21c0-3.2 2.6-5.8 5.8-5.8h57.5c3.2 0 5.8 2.6 5.8 5.8v5.8z"/><path class="st0" d="M11.5 52.9V44c0-3.2-2.6-5.8-5.8-5.8S0 40.8 0 44v28.8c0 6.4 5.1 11.5 11.5 11.5h69c6.4 0 11.5-5.1 11.5-11.5V15.2c0-6.4-5.1-11.5-11.5-11.5H51.8c-3.2 0-5.8 2.6-5.8 5.8 0 3.2 2.6 5.8 5.8 5.8h23c3.2 0 5.8 2.6 5.8 5.8v40.5c0 6.2-2.6 11.2-5.8 11.2H17.2c-3.2 0-5.8-5-5.8-11.2v-8.7z"/><path class="st0" d="M47.3 37.7c-.3.3-.8.5-1.3.5s-.9-.2-1.3-.5c-2.4-2.4-5.6-3.7-9-3.7s-6.6 1.3-9 3.7c-4.2 4.3-4.9 10.9-1.7 16 1 1.5 2.2 2.7 3.7 3.7L45 70.6c.3.2.6.4 1 .4s.7-.1 1-.4l16.2-13.2c4-2.7 6.2-7.4 5.6-12.2s-3.8-8.9-8.4-10.5-9.7-.4-13.1 3z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><title>default-browser-16</title><path fill="#0A84FF" d="M8,6s0-4,3.5-4S15,5,15,6c0,4.5-7,9-7,9Z"/><path fill="#0A84FF" d="M8,6S8,2,4.5,2,1,5,1,6c0,4.5,7,9,7,9L9,9Z"/></svg>

До

Ширина:  |  Высота:  |  Размер: 978 B

После

Ширина:  |  Высота:  |  Размер: 257 B

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 5.8 KiB

После

Ширина:  |  Высота:  |  Размер: 5.2 KiB

Просмотреть файл

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 92 92"><style>.st0{fill:#3E3D40;}</style><path class="st0" d="M80.5 3.8h-69C5.1 3.8 0 8.9 0 15.3v57.5c0 6.4 5.1 11.5 11.5 11.5h28.8c3.2 0 5.8-2.6 5.8-5.8 0-3.2-2.6-5.8-5.8-5.8h-23c-3.2 0-5.8-2.6-5.8-5.8V32.5h69V44c0 3.2 2.6 5.8 5.8 5.8s5.8-2.6 5.8-5.8V15.2C92 8.9 86.9 3.8 80.5 3.8zm0 23h-69V21c0-3.2 2.6-5.8 5.8-5.8h57.5c3.2 0 5.8 2.6 5.8 5.8v5.8z"/><path class="st0" d="M11.5 52.9V44c0-3.2-2.6-5.8-5.8-5.8S0 40.8 0 44v28.8c0 6.4 5.1 11.5 11.5 11.5h69c6.4 0 11.5-5.1 11.5-11.5V15.2c0-6.4-5.1-11.5-11.5-11.5H51.8c-3.2 0-5.8 2.6-5.8 5.8 0 3.2 2.6 5.8 5.8 5.8h23c3.2 0 5.8 2.6 5.8 5.8v40.5c0 6.2-2.6 11.2-5.8 11.2H17.2c-3.2 0-5.8-5-5.8-11.2v-8.7z"/><path class="st0" d="M47.3 37.7c-.3.3-.8.5-1.3.5s-.9-.2-1.3-.5c-2.4-2.4-5.6-3.7-9-3.7s-6.6 1.3-9 3.7c-4.2 4.3-4.9 10.9-1.7 16 1 1.5 2.2 2.7 3.7 3.7L45 70.6c.3.2.6.4 1 .4s.7-.1 1-.4l16.2-13.2c4-2.7 6.2-7.4 5.6-12.2s-3.8-8.9-8.4-10.5-9.7-.4-13.1 3z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><title>default-browser-16</title><path fill="context-fill" d="M8,6s0-4,3.5-4S15,5,15,6c0,4.5-7,9-7,9Z"/><path fill="context-fill" d="M8,6S8,2,4.5,2,1,5,1,6c0,4.5,7,9,7,9L9,9Z"/></svg>

До

Ширина:  |  Высота:  |  Размер: 978 B

После

Ширина:  |  Высота:  |  Размер: 267 B

Просмотреть файл

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="92px" height="92px" viewBox="0 0 92 92" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>Tip / Icon / Library</title><desc>Created with Sketch.</desc><defs></defs><g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tip-/-Icon-/-Library" fill-rule="nonzero" fill="#0C0C0D"><g id="Icon-/-Library-/-Web"><path fill="#0A84FF" d="M28.7405828,17.2350375 C25.5662458,17.2350375 22.9929371,19.8060508 22.9929371,22.9775563 L22.9929371,80.402744 C22.9929371,83.5742496 25.5662458,86.1452628 28.7405828,86.1452628 C31.9149199,86.1452628 34.4882285,83.5742496 34.4882285,80.402744 L34.4882285,22.9775563 C34.4882285,19.8060508 31.9149199,17.2350375 28.7405828,17.2350375 Z M45.98352,11.4925188 C42.8091829,11.4925188 40.2358743,14.063532 40.2358743,17.2350375 L40.2358743,80.402744 C40.2358743,83.5742496 42.8091829,86.1452628 45.98352,86.1452628 C49.157857,86.1452628 51.7311657,83.5742496 51.7311657,80.402744 L51.7311657,17.2350375 C51.7311657,14.063532 49.157857,11.4925188 45.98352,11.4925188 Z M91.6140792,78.4388026 L68.6234964,15.2710961 C67.9500245,13.3049026 66.2658683,11.8556604 64.2198302,11.4816739 C62.1737921,11.1076875 60.0851643,11.8673187 58.7585671,13.4679283 C57.4319699,15.0685378 57.0744241,17.2603443 57.8236701,19.198979 L80.814253,82.3666855 C81.4877249,84.332879 83.1718811,85.7821212 85.2179192,86.1561076 C87.2639573,86.5300941 89.3525851,85.7704629 90.6791823,84.1698533 C92.0057794,82.5692438 92.3633253,80.3774372 91.6140792,78.4388026 L91.6140792,78.4388026 Z M11.4976457,5.75 C8.32330864,5.75 5.75,8.32101323 5.75,11.4925188 L5.75,80.402744 C5.75,83.5742496 8.32330864,86.1452628 11.4976457,86.1452628 C14.6719828,86.1452628 17.2452914,83.5742496 17.2452914,80.402744 L17.2452914,11.4925188 C17.2452914,8.32101323 14.6719828,5.75 11.4976457,5.75 Z" id="Shape"></path></g></g></g></svg>

После

Ширина:  |  Высота:  |  Размер: 1.9 KiB

Просмотреть файл

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:none;}.cls-2{fill:#009e83;}.cls-3{fill:#cd6f14;}.cls-4{fill:#f9f9fa;}.cls-5{fill:#f70;}.cls-6{fill:#2b3b47;}.cls-7{fill:#b5007f;}.cls-8{fill:#ed00b5;}.cls-9{fill:#8000d7;}</style></defs><title>Artboard 1</title><g id="Layer_1" data-name="Layer 1"><rect class="cls-1" width="64" height="64"/></g><g id="Layer_9" data-name="Layer 9"><g id="Layer_2" data-name="Layer 2"><rect class="cls-2" x="16.12" y="7.78" width="8.59" height="10.77"/></g><g id="Layer_3" data-name="Layer 3"><circle class="cls-3" cx="23.72" cy="8.26" r="7.6"/></g><g id="Layer_4" data-name="Layer 4"><path class="cls-3" d="M55.69,44.24H25.07a3.83,3.83,0,0,1-3.83-3.83V4.51c0-2.11.1-3.83,2.22-3.83h31a5,5,0,0,1,5,5V40.41A3.83,3.83,0,0,1,55.69,44.24Z"/></g><g id="Layer_5" data-name="Layer 5"><path class="cls-4" d="M57.35,7.26C57.35,5,55.21,3.14,52.52,3H23.72c-2.1,0-3.8,1.3-3.8,2.91s1.7,2.91,3.8,2.91v0H44.59V49.09l7.6.89c3,0,5.16-5.84,5.16-8.73V7.46h0C57.35,7.39,57.35,7.32,57.35,7.26Z"/></g><g id="Layer_6" data-name="Layer 6"><path class="cls-5" d="M50.62,52.42H19.89a3.77,3.77,0,0,1-3.77-3.77v-36c0-2.08,5.52-3.77,7.6-3.77h26.9a3.77,3.77,0,0,1,3.77,3.77v36A3.77,3.77,0,0,1,50.62,52.42Z"/></g><g id="Layer_7" data-name="Layer 7"><path class="cls-3" d="M23.94,52.42H19.76a3.64,3.64,0,0,1-3.64-3.64V8.86h7.82V52.42Z"/></g><g id="Layer_8" data-name="Layer 8"><path class="cls-6" d="M44.75,25H31.07a1.48,1.48,0,0,1-1.48-1.48V18.36a1.48,1.48,0,0,1,1.48-1.48H44.75a1.48,1.48,0,0,1,1.48,1.48v5.16A1.48,1.48,0,0,1,44.75,25Z"/></g><g id="Layer_2-2" data-name="Layer 2"><rect class="cls-2" x="4.47" y="18.7" width="8.59" height="10.77"/></g><g id="Layer_3-2" data-name="Layer 3"><circle class="cls-7" cx="12.07" cy="19.18" r="7.6"/></g><g id="Layer_4-2" data-name="Layer 4"><path class="cls-7" d="M44,55.16H13.42a3.83,3.83,0,0,1-3.83-3.83V15.43c0-2.11.1-3.83,2.22-3.83h31a5,5,0,0,1,5,5V51.33A3.83,3.83,0,0,1,44,55.16Z"/></g><g id="Layer_5-2" data-name="Layer 5"><path class="cls-4" d="M45.7,18.18c0-2.26-2.13-4.11-4.83-4.25H12.07c-2.1,0-3.8,1.3-3.8,2.91s1.7,2.91,3.8,2.91v0H32.94V60l7.6.89c3,0,5.16-5.84,5.16-8.73V18.38h0C45.7,18.31,45.7,18.24,45.7,18.18Z"/></g><g id="Layer_6-2" data-name="Layer 6"><path class="cls-8" d="M39,63.34H8.24a3.77,3.77,0,0,1-3.77-3.77v-36c0-2.08,5.52-3.77,7.6-3.77H39a3.77,3.77,0,0,1,3.77,3.77v36A3.77,3.77,0,0,1,39,63.34Z"/></g><g id="Layer_7-2" data-name="Layer 7"><path class="cls-7" d="M12.3,63.34H8.12A3.64,3.64,0,0,1,4.47,59.7V19.78H12.3V63.34Z"/></g><g id="Layer_8-2" data-name="Layer 8"><path class="cls-9" d="M33.1,35.92H19.43a1.48,1.48,0,0,1-1.48-1.48V29.28a1.48,1.48,0,0,1,1.48-1.48H33.1a1.48,1.48,0,0,1,1.48,1.48v5.16A1.48,1.48,0,0,1,33.1,35.92Z"/></g></g></svg>

После

Ширина:  |  Высота:  |  Размер: 2.7 KiB

Просмотреть файл

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="92px" height="92px" viewBox="0 0 92 92" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>Tip / Icon / Library</title><desc>Created with Sketch.</desc><defs></defs><g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tip-/-Icon-/-Library" fill-rule="nonzero" fill="#0C0C0D"><g id="Icon-/-Library-/-Web"><path d="M28.7405828,17.2350375 C25.5662458,17.2350375 22.9929371,19.8060508 22.9929371,22.9775563 L22.9929371,80.402744 C22.9929371,83.5742496 25.5662458,86.1452628 28.7405828,86.1452628 C31.9149199,86.1452628 34.4882285,83.5742496 34.4882285,80.402744 L34.4882285,22.9775563 C34.4882285,19.8060508 31.9149199,17.2350375 28.7405828,17.2350375 Z M45.98352,11.4925188 C42.8091829,11.4925188 40.2358743,14.063532 40.2358743,17.2350375 L40.2358743,80.402744 C40.2358743,83.5742496 42.8091829,86.1452628 45.98352,86.1452628 C49.157857,86.1452628 51.7311657,83.5742496 51.7311657,80.402744 L51.7311657,17.2350375 C51.7311657,14.063532 49.157857,11.4925188 45.98352,11.4925188 Z M91.6140792,78.4388026 L68.6234964,15.2710961 C67.9500245,13.3049026 66.2658683,11.8556604 64.2198302,11.4816739 C62.1737921,11.1076875 60.0851643,11.8673187 58.7585671,13.4679283 C57.4319699,15.0685378 57.0744241,17.2603443 57.8236701,19.198979 L80.814253,82.3666855 C81.4877249,84.332879 83.1718811,85.7821212 85.2179192,86.1561076 C87.2639573,86.5300941 89.3525851,85.7704629 90.6791823,84.1698533 C92.0057794,82.5692438 92.3633253,80.3774372 91.6140792,78.4388026 L91.6140792,78.4388026 Z M11.4976457,5.75 C8.32330864,5.75 5.75,8.32101323 5.75,11.4925188 L5.75,80.402744 C5.75,83.5742496 8.32330864,86.1452628 11.4976457,86.1452628 C14.6719828,86.1452628 17.2452914,83.5742496 17.2452914,80.402744 L17.2452914,11.4925188 C17.2452914,8.32101323 14.6719828,5.75 11.4976457,5.75 Z" id="Shape"></path></g></g></g></svg>

После

Ширина:  |  Высота:  |  Размер: 1.9 KiB

Просмотреть файл

@ -1 +1 @@
<svg width="16" height="16" viewBox="0 0 92 92" xmlns="http://www.w3.org/2000/svg"><title>Tip / Icon / Performance</title><g id="Symbols" fill="none" fill-rule="evenodd"><g id="Tip-/-Icon-/-Performance" fill="#0A84FF"><path d="M47.237 53.003L47 53c-6.075 0-11 4.925-11 11s4.925 11 11 11c4.453 0 8.287-2.645 10.018-6.45 1.888-3.525 2.97-7.84 8.397-12.066 7.422-5.778 15.097-10.033 14.61-11.098-.485-1.06-8.04 2.724-16.675 5.79-7.916 2.812-14.765 1.706-16.113 1.827zm-36.467 31.3C4.05 76.316 0 66.015 0 54.768 0 29.4 20.593 8.838 46 8.838c25.404 0 46 20.563 46 45.93 0 11.247-4.05 21.548-10.77 29.535H10.77zM46 21.698c-1.016 0-1.84 1.646-1.84 3.674s.824 3.675 1.84 3.675 1.84-1.647 1.84-3.675c0-2.028-.824-3.674-1.84-3.674zm34.96 40.418c0-1.016-1.65-1.837-3.68-1.837-2.03 0-3.68.82-3.68 1.836s1.65 1.837 3.68 1.837c2.03 0 3.68-.82 3.68-1.837zm-62.364 0c0-1.016-1.65-1.837-3.68-1.837-2.032 0-3.68.82-3.68 1.836s1.648 1.837 3.68 1.837c2.03 0 3.68-.82 3.68-1.837zm7.664-23.133c.73-.706.18-2.46-1.232-3.92s-3.15-2.072-3.88-1.366c-.73.704-.178 2.458 1.234 3.92 1.41 1.457 3.148 2.07 3.878 1.366zm46-5.287c-.73-.706-2.468-.094-3.88 1.367-1.41 1.46-1.962 3.215-1.232 3.92.73.704 2.47.092 3.88-1.368 1.412-1.46 1.964-3.214 1.233-3.92z" id="Combined-Shape"/></g></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="#0A84FF" d="M8 1a8.009 8.009 0 0 0-8 8 7.917 7.917 0 0 0 .78 3.43 1 1 0 1 0 1.8-.86A5.943 5.943 0 0 1 2 9a6 6 0 1 1 11.414 2.571 1 1 0 1 0 1.807.858A7.988 7.988 0 0 0 8 1z"/><path fill="#0A84FF" d="M11.769 7.078a.5.5 0 0 0-.69.153L8.616 11.1a2 2 0 1 0 .5 3.558 2.011 2.011 0 0 0 .54-.54 1.954 1.954 0 0 0-.2-2.479l2.463-3.871a.5.5 0 0 0-.15-.69z"/></svg>

До

Ширина:  |  Высота:  |  Размер: 1.2 KiB

После

Ширина:  |  Высота:  |  Размер: 450 B

Просмотреть файл

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:none;}.cls-2{fill:#00c8d7;}.cls-3{fill:#00feff;}</style></defs><title>Artboard 1</title><g id="Layer_1" data-name="Layer 1"><rect class="cls-1" width="64" height="64"/></g><g id="Layer_8" data-name="Layer 8"><path class="cls-2" d="M.23,37.15A13.75,13.75,0,0,0,19,49.95a1.42,1.42,0,0,0,.17.61,14.53,14.53,0,0,0,27.26-7V41.22H62.63a1.37,1.37,0,1,0,0-2.74H45a1.37,1.37,0,0,0-1.37,1.37v3.71a11.78,11.78,0,0,1-22.11,5.67,1.39,1.39,0,0,0-.35-.41,13.75,13.75,0,0,0,6.5-11.67,1.37,1.37,0,1,0-2.74,0,11,11,0,1,1-11-11,1.37,1.37,0,0,0,.5-.1,15.86,15.86,0,0,0,5.34,7.59,1.42,1.42,0,0,0,.85.29,1.37,1.37,0,0,0,.85-2.45A13.14,13.14,0,1,1,42.72,21.1v2a1.37,1.37,0,0,0,1.37,1.37H61.94a1.37,1.37,0,0,0,0-2.74H45.46v-.66a15.88,15.88,0,1,0-31.77,0,15.52,15.52,0,0,0,.16,2.29A13.77,13.77,0,0,0,.23,37.15Z"/><path class="cls-3" d="M45.14,38.43H57.58v-14H44.09a1.37,1.37,0,0,1-1.37-1.37v-2a13.14,13.14,0,1,0-26.29,0,12.9,12.9,0,0,0,.16,2.08,13.6,13.6,0,0,0,.51,2h0a13,13,0,0,0,4.44,6.3,1.38,1.38,0,0,1,.24,1.93,1.4,1.4,0,0,1-1.08.52,1.34,1.34,0,0,1-.85-.29A15.78,15.78,0,0,1,14.47,26a1.32,1.32,0,0,1-.5.1,11,11,0,1,0,11,11,1.37,1.37,0,1,1,2.74,0,13.75,13.75,0,0,1-6.5,11.67,1.39,1.39,0,0,1,.35.41,11.78,11.78,0,0,0,22.11-5.67V39.82A1.37,1.37,0,0,1,45,38.45h.1Z"/><path class="cls-2" d="M43.77,31.77a1.37,1.37,0,0,1,1.37-1.37H62.63a1.37,1.37,0,0,1,0,2.74H45.14A1.37,1.37,0,0,1,43.77,31.77Z"/></g></svg>

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Просмотреть файл

@ -1 +1 @@
<svg width="16" height="16" viewBox="0 0 92 92" xmlns="http://www.w3.org/2000/svg"><title>Tip / Icon / Performance</title><g id="Symbols" fill="none" fill-rule="evenodd"><g id="Tip-/-Icon-/-Performance" fill="#3E3D40"><path d="M47.237 53.003L47 53c-6.075 0-11 4.925-11 11s4.925 11 11 11c4.453 0 8.287-2.645 10.018-6.45 1.888-3.525 2.97-7.84 8.397-12.066 7.422-5.778 15.097-10.033 14.61-11.098-.485-1.06-8.04 2.724-16.675 5.79-7.916 2.812-14.765 1.706-16.113 1.827zm-36.467 31.3C4.05 76.316 0 66.015 0 54.768 0 29.4 20.593 8.838 46 8.838c25.404 0 46 20.563 46 45.93 0 11.247-4.05 21.548-10.77 29.535H10.77zM46 21.698c-1.016 0-1.84 1.646-1.84 3.674s.824 3.675 1.84 3.675 1.84-1.647 1.84-3.675c0-2.028-.824-3.674-1.84-3.674zm34.96 40.418c0-1.016-1.65-1.837-3.68-1.837-2.03 0-3.68.82-3.68 1.836s1.65 1.837 3.68 1.837c2.03 0 3.68-.82 3.68-1.837zm-62.364 0c0-1.016-1.65-1.837-3.68-1.837-2.032 0-3.68.82-3.68 1.836s1.648 1.837 3.68 1.837c2.03 0 3.68-.82 3.68-1.837zm7.664-23.133c.73-.706.18-2.46-1.232-3.92s-3.15-2.072-3.88-1.366c-.73.704-.178 2.458 1.234 3.92 1.41 1.457 3.148 2.07 3.878 1.366zm46-5.287c-.73-.706-2.468-.094-3.88 1.367-1.41 1.46-1.962 3.215-1.232 3.92.73.704 2.47.092 3.88-1.368 1.412-1.46 1.964-3.214 1.233-3.92z" id="Combined-Shape"/></g></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="context-fill" d="M8 1a8.009 8.009 0 0 0-8 8 7.917 7.917 0 0 0 .78 3.43 1 1 0 1 0 1.8-.86A5.943 5.943 0 0 1 2 9a6 6 0 1 1 11.414 2.571 1 1 0 1 0 1.807.858A7.988 7.988 0 0 0 8 1z"/><path fill="context-fill" d="M11.769 7.078a.5.5 0 0 0-.69.153L8.616 11.1a2 2 0 1 0 .5 3.558 2.011 2.011 0 0 0 .54-.54 1.954 1.954 0 0 0-.2-2.479l2.463-3.871a.5.5 0 0 0-.15-.69z"/></svg>

До

Ширина:  |  Высота:  |  Размер: 1.2 KiB

После

Ширина:  |  Высота:  |  Размер: 460 B

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 5.8 KiB

После

Ширина:  |  Высота:  |  Размер: 4.8 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 417 B

После

Ширина:  |  Высота:  |  Размер: 417 B

Просмотреть файл

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:none;}.cls-2{fill:#fff;}.cls-3{fill:#e1e1e5;}.cls-4{fill:#a0a7e6;}.cls-5{fill:#f9f9fa;}.cls-6{fill:#cd6f14;}.cls-7{fill:#a4000f;}</style></defs><title>Artboard 1</title><g id="Layer_1" data-name="Layer 1"><rect class="cls-1" width="64" height="64"/></g><g id="Layer_7" data-name="Layer 7"><path class="cls-1" d="M3.62,44.42H42.49L56.8,60a1.69,1.69,0,0,0,1.23.45,6.19,6.19,0,0,0,3.94-2,5.83,5.83,0,0,0,2-4.21,6,6,0,0,1-2,4.1c-1.86,1.86-4.19,2.57-5.18,1.58L42.49,44.31H3.62A3.55,3.55,0,0,1,.07,40.77V27h0V40.88A3.55,3.55,0,0,0,3.62,44.42Z"/><path class="cls-1" d="M53.93,44.3l.1.09a3.53,3.53,0,0,0,3.4-3.51v-.11A3.54,3.54,0,0,1,53.93,44.3Z"/><path class="cls-2" d="M52.52,43h1.36a2.25,2.25,0,0,0,2.25-2.25V26.9a2.25,2.25,0,0,0-2.25-2.25H46.43A19.7,19.7,0,0,1,42.53,35l1.7,1.7a2.19,2.19,0,0,1,2.06.59Z"/><path class="cls-2" d="M40.36,40.57l-1.7-1.7A19.82,19.82,0,0,1,7,24.66H3.62A2.25,2.25,0,0,0,1.37,26.9V40.77A2.25,2.25,0,0,0,3.62,43H41.3l-.35-.38A2.19,2.19,0,0,1,40.36,40.57Z"/><path class="cls-3" d="M3.62,44.31H42.49L41.3,43H3.62a2.25,2.25,0,0,1-2.25-2.25V26.9a2.25,2.25,0,0,1,2.25-2.25H7c0-.42-.05-.84-.06-1.25,0,0,0,0,0,.07H3.62A3.55,3.55,0,0,0,.07,27V40.77A3.55,3.55,0,0,0,3.62,44.31Z"/><path class="cls-3" d="M53.88,24.66a2.25,2.25,0,0,1,2.25,2.25V40.77A2.25,2.25,0,0,1,53.88,43H52.52l.71.65.7.64a3.54,3.54,0,0,0,3.5-3.53V27a3.55,3.55,0,0,0-3.54-3.54H46.46s0,0,0,0c0,.41,0,.82,0,1.23Z"/><path class="cls-4" d="M12.68,37.07a19.84,19.84,0,0,0,26,1.8l1.7,1.7a6,6,0,0,1,3.87-3.87L42.53,35a19.7,19.7,0,0,0,3.9-10.35c0-.41,0-.82,0-1.23A19.78,19.78,0,0,0,42.2,10.8l-.26-.31c-.38-.46-.78-.92-1.21-1.35A19.82,19.82,0,0,0,6.89,23.4c0,.42,0,.84.06,1.25A19.74,19.74,0,0,0,12.68,37.07ZM11.44,17.74a16.07,16.07,0,0,1,1.16-2.6h.09a16.12,16.12,0,0,1,28,0h.07c.1.18.16.39.26.58s.21.34.29.52L41.21,16a16.49,16.49,0,0,1,.76,1.7A16.16,16.16,0,0,1,13,31.65c0,.07.06.15.09.23-.15-.24-.27-.5-.41-.75s-.26-.46-.38-.7-.29-.56-.41-.86a16,16,0,0,1-.67-1.77l0-.12a16.11,16.11,0,0,1-.46-2.08l0-.15a15.54,15.54,0,0,1,.71-7.71Z"/><path class="cls-5" d="M27.75,8.8a16.13,16.13,0,0,0-12.83,6.35H40.56A16.11,16.11,0,0,0,27.75,8.8Z"/><path class="cls-2" d="M10.57,23.16a16.11,16.11,0,0,1,.95-5.41h-.07a15.54,15.54,0,0,0-.71,7.71A16.23,16.23,0,0,1,10.57,23.16Z"/><path class="cls-2" d="M11.57,25A16.09,16.09,0,0,0,13,31.65,16.15,16.15,0,0,0,42,17.74H13.29A16.08,16.08,0,0,0,11.57,25Z"/><path class="cls-3" d="M10.57,23.16a16.23,16.23,0,0,0,.17,2.3l0,.15a16.11,16.11,0,0,0,.46,2.08l0,.12a16,16,0,0,0,.67,1.77c.13.29.27.57.41.86s.25.47.38.7.26.51.41.75c0-.07-.06-.15-.09-.23a16.05,16.05,0,0,1,.26-13.9H42a16.49,16.49,0,0,0-.76-1.7l.15.21c-.09-.18-.19-.35-.29-.52s-.16-.4-.26-.58h-.07a16.12,16.12,0,0,0-28,0H12.6a16.07,16.07,0,0,0-1.16,2.6h.07A16.11,16.11,0,0,0,10.57,23.16ZM27.75,8.8a16.11,16.11,0,0,1,12.81,6.35H14.92A16.13,16.13,0,0,1,27.75,8.8Z"/><path class="cls-6" d="M45.81,47.93l5.77-5.77,1.64,1.51L52.52,43l-6.23-5.72a2.19,2.19,0,0,0-2.06-.59,6,6,0,0,0-3.87,3.87,2.19,2.19,0,0,0,.59,2.06l.35.38,1.19,1.3L56.8,59.9c1,1,3.32.28,5.18-1.58a6,6,0,0,0,2-4.1,1.58,1.58,0,0,0-.43-1L60,50l-6.41,6.41Z"/><path class="cls-7" d="M53.23,43.66l-1.64-1.51-5.77,5.77,7.81,8.5L60,50l-6.11-5.61.1,0-.1-.09Z"/></g></svg>

После

Ширина:  |  Высота:  |  Размер: 3.2 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 417 B

После

Ширина:  |  Высота:  |  Размер: 417 B

Просмотреть файл

@ -1 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><defs><style>.cls-1{fill:none;}.cls-2{fill:#767aa8;}.cls-3{fill:#f9f9fa;}.cls-4{fill:#e1e1e5;}.cls-5{fill:#fff;}.cls-6{fill:#0a84ff;}.cls-7{fill:#f5f5f7;}</style></defs><title>icons</title><path class="cls-1" d="M20.51,8.55h0V7.2a.5.5,0,0,0-.08-.25.5.5,0,0,1,0,.17Z"/><path class="cls-1" d="M26.67,8.55h0a.26.26,0,0,0-.07-.15.25.25,0,0,1,0,.11Z"/><path class="cls-1" d="M28.11,25.26A1.07,1.07,0,0,1,27,26.33H19.09a1.06,1.06,0,0,1-1-.6,1.07,1.07,0,0,0,1,.69h7.95a1.07,1.07,0,0,0,1.07-1.07V9.7A1,1,0,0,0,28,9.23a1.06,1.06,0,0,1,.08.39Z"/><path class="cls-1" d="M4.67,21.81a.47.47,0,0,1-.4-.22.47.47,0,0,0,.44.31H18v-.08Z"/><path class="cls-2" d="M4.67,21.81H18V20.71H5.63a.41.41,0,0,1-.41-.41V9h13a1.05,1.05,0,0,1,.86-.46h1.42V7.11A.43.43,0,0,0,20,6.69H4.75a.51.51,0,0,0-.51.51V21.45a.41.41,0,0,0,0,.14A.47.47,0,0,0,4.67,21.81ZM19.21,7.46a.42.42,0,0,1,.38.38.35.35,0,0,1-.35.35.42.42,0,0,1-.38-.38A.35.35,0,0,1,19.21,7.46Zm-1.09,0a.35.35,0,1,1-.35.35A.35.35,0,0,1,18.12,7.49Zm-10.32.3a.38.38,0,0,1,.38-.38h8.2a.38.38,0,0,1,.38.38v0a.38.38,0,0,1-.38.38H8.17a.38.38,0,0,1-.38-.38ZM6.55,7.46a.35.35,0,1,1-.35.35A.35.35,0,0,1,6.55,7.46Zm-1.12,0a.35.35,0,1,1-.35.35A.35.35,0,0,1,5.43,7.46Z"/><circle class="cls-3" cx="5.43" cy="7.81" r="0.35"/><circle class="cls-3" cx="6.55" cy="7.81" r="0.35"/><rect class="cls-3" x="7.79" y="7.41" width="8.96" height="0.79" rx="0.38" ry="0.38"/><path class="cls-3" d="M17.82,19.1a1.17,1.17,0,0,1-1.17-1.17V17a1.1,1.1,0,0,1-.62.21,1.11,1.11,0,0,1-.68-.24l-3-2.28a1.12,1.12,0,0,1,0-1.78l3-2.28a1.11,1.11,0,0,1,.68-.24,1.13,1.13,0,0,1,1.13,1.12v.36H18V9.62A1,1,0,0,1,18.24,9h-13V20.3a.41.41,0,0,0,.41.41H18V19.1Z"/><circle class="cls-3" cx="18.12" cy="7.84" r="0.35"/><path class="cls-3" d="M19.24,8.18a.35.35,0,0,0,.35-.35.42.42,0,0,0-.38-.38.35.35,0,0,0-.35.35.42.42,0,0,0,.38.38Z"/><path class="cls-4" d="M19.09,8.55A1.12,1.12,0,0,0,18,9.62v2.3h.88a1.1,1.1,0,0,1,.16,0V10.2a.47.47,0,0,1,.48-.46h7a.54.54,0,0,1,.54.54v13a.54.54,0,0,1-.54.54h-7a.54.54,0,0,1-.54-.54V19.1H18v2.79h0v3.45a1,1,0,0,0,1,1H27a1.07,1.07,0,0,0,1.07-1.07V9.62a1,1,0,0,0-1-1h-.37v0s0,0,0,0h0v0a.25.25,0,0,0,0-.11.26.26,0,0,0-.18-.07H25a.26.26,0,0,0-.25.22s0,0,0,0v0H20.55V8.55H19.09Zm5.09,16.54a.45.45,0,0,1-.45.45H22.28a.45.45,0,0,1-.45-.45v0a.45.45,0,0,1,.45-.45h1.45a.45.45,0,0,1,.45.45Z"/><path class="cls-3" d="M24.32,16.28a1.12,1.12,0,0,1,0,1.78l-3,2.28a1.11,1.11,0,0,1-1.8-.82l-.52.92V23.3a.54.54,0,0,0,.54.54h7a.54.54,0,0,0,.54-.54v-13a.54.54,0,0,0-.54-.54H25.1l-2.81,5Z"/><path class="cls-5" d="M20.06,13.09V14a1.1,1.1,0,0,1,.62-.21,1.11,1.11,0,0,1,.68.24l.92.71,2.81-5H19.53a.47.47,0,0,0-.48.46V12A1.16,1.16,0,0,1,20.06,13.09Z"/><path class="cls-5" d="M19.56,19.45V19.1h-.51v1.35l.52-.92S19.56,19.48,19.56,19.45Z"/><path class="cls-6" d="M17.15,16.53v1.4a.67.67,0,0,0,.67.67h2.24v.86a.62.62,0,0,0,.63.62.61.61,0,0,0,.38-.13l3-2.28a.62.62,0,0,0,0-1l-3-2.28a.61.61,0,0,0-.38-.13.62.62,0,0,0-.63.62v1H17.82A.67.67,0,0,0,17.15,16.53Z"/><path class="cls-6" d="M16.65,11.56a.62.62,0,0,0-.63-.62.61.61,0,0,0-.38.13l-3,2.28a.62.62,0,0,0,0,1l3,2.28a.61.61,0,0,0,.38.13.62.62,0,0,0,.63-.62v-1H18.9a.67.67,0,0,0,.67-.67v-1.4a.67.67,0,0,0-.67-.67H16.65Z"/><path class="cls-7" d="M17.15,11.56A1.13,1.13,0,0,0,16,10.44a1.11,1.11,0,0,0-.68.24l-3,2.28a1.12,1.12,0,0,0,0,1.78l3,2.28a1.11,1.11,0,0,0,.68.24,1.1,1.1,0,0,0,.62-.21v.88a1.17,1.17,0,0,0,1.17,1.17h1.74v.36s0,0,0,.07a1.11,1.11,0,0,0,1.8.82l3-2.28a1.12,1.12,0,0,0,0-1.78l-2-1.57L21.37,14a1.11,1.11,0,0,0-.68-.24,1.1,1.1,0,0,0-.62.21v-.88a1.16,1.16,0,0,0-1-1.14,1.1,1.1,0,0,0-.16,0H17.15Zm2.9,4.3v-1a.62.62,0,0,1,.63-.62.61.61,0,0,1,.38.13l3,2.28a.62.62,0,0,1,0,1l-3,2.28a.61.61,0,0,1-.38.13.62.62,0,0,1-.63-.62V18.6H17.82a.67.67,0,0,1-.67-.67v-1.4a.67.67,0,0,1,.67-.67ZM18.9,12.42a.67.67,0,0,1,.67.67v1.4a.67.67,0,0,1-.67.67H16.65v1a.62.62,0,0,1-.63.62.61.61,0,0,1-.38-.13l-3-2.28a.62.62,0,0,1,0-1l3-2.28a.61.61,0,0,1,.38-.13.62.62,0,0,1,.63.62v.86Z"/><rect class="cls-3" x="21.83" y="24.62" width="2.35" height="0.92" rx="0.45" ry="0.45"/><path class="cls-5" d="M4.71,22.89H17.06v2.45a2.07,2.07,0,0,0,2.07,2.07h7.95a2.07,2.07,0,0,0,2.07-2.07V9.7a2.07,2.07,0,0,0-1.88-2.06,1.25,1.25,0,0,0-.83-.31H25a1.26,1.26,0,0,0-.82.3H21.55V7.2A1.51,1.51,0,0,0,20,5.69H4.75A1.51,1.51,0,0,0,3.24,7.2V21.45A1.46,1.46,0,0,0,4.71,22.89ZM4.24,9.09V7.2a.51.51,0,0,1,.51-.51H20a.5.5,0,0,1,.43.26.5.5,0,0,1,.08.25V8.63h4.13v0s0,0,0,0A.26.26,0,0,1,25,8.33h1.49a.26.26,0,0,1,.18.07.26.26,0,0,1,.07.15s0,0,0,0v0h.37a1.06,1.06,0,0,1,1,.6,1,1,0,0,1,.12.47V25.34a1.07,1.07,0,0,1-1.07,1.07H19.13a1.09,1.09,0,0,1-1.07-1.07V21.89H4.71a.47.47,0,0,1-.44-.31.41.41,0,0,1,0-.14Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:none;}.cls-2{fill:#767aa8;}.cls-3{fill:#f9f9fa;}.cls-4{fill:#a0a7e6;}.cls-5{fill:#fff;}.cls-6{fill:#0a84ff;}.cls-7{fill:#0060df;}.cls-8{fill:#f5f5f7;}</style></defs><title>Artboard 1</title><g id="Layer_1" data-name="Layer 1"><rect class="cls-1" width="64" height="64"/></g><g id="Layer_5" data-name="Layer 5"><path class="cls-1" d="M43.49,11.2h.11V7.59a1.32,1.32,0,0,0-.2-.67,1.34,1.34,0,0,1,.09.45Z"/><path class="cls-1" d="M59.9,11.2H60a.7.7,0,0,0-.18-.39.66.66,0,0,1,.12.29Z"/><path class="cls-1" d="M63.73,55.69a2.85,2.85,0,0,1-2.85,2.85H39.71a2.83,2.83,0,0,1-2.54-1.6,2.84,2.84,0,0,0,2.65,1.83H61a2.85,2.85,0,0,0,2.85-2.85V14.27A2.79,2.79,0,0,0,63.52,13a2.83,2.83,0,0,1,.21,1Z"/><path class="cls-1" d="M1.3,46.5a1.26,1.26,0,0,1-1.07-.6,1.24,1.24,0,0,0,1.18.82H36.86V46.5Z"/><path class="cls-2" d="M1.3,46.5H36.86V43.59h-33a1.1,1.1,0,0,1-1.1-1.1V12.42H37.43a2.8,2.8,0,0,1,2.28-1.22h3.78V7.37a1.34,1.34,0,0,0-.09-.45,1.34,1.34,0,0,0-1.16-.69H1.51A1.36,1.36,0,0,0,.15,7.59V45.54a1.09,1.09,0,0,0,.08.36A1.26,1.26,0,0,0,1.3,46.5ZM40,8.29a.91.91,0,0,1,.69.32A.91.91,0,0,1,41,9.3a.93.93,0,0,1-.93.93.91.91,0,0,1-.69-.32.91.91,0,0,1-.32-.69A.93.93,0,0,1,40,8.29Zm-2.91.08a.93.93,0,1,1-.93.93A.93.93,0,0,1,37.12,8.37Zm-27.49.8a1,1,0,0,1,1-1H32.47a1,1,0,0,1,1,1v.09a1,1,0,0,1-1,1H10.63a1,1,0,0,1-1-1ZM6.31,8.29a.93.93,0,1,1-.93.93A.93.93,0,0,1,6.31,8.29Zm-3,0a.93.93,0,1,1-.93.93A.93.93,0,0,1,3.33,8.29Z"/><rect class="cls-3" x="9.62" y="8.17" width="23.85" height="2.1" rx="1" ry="1"/><path class="cls-3" d="M36.31,39.28a3.12,3.12,0,0,1-3.11-3.11V33.81a2.92,2.92,0,0,1-1.65.56,3,3,0,0,1-1.82-.63l-7.86-6.08a3,3,0,0,1,0-4.73l7.86-6.08a3,3,0,0,1,1.82-.63,3,3,0,0,1,3,3v1h2.3V14.05a2.78,2.78,0,0,1,.58-1.63H2.77V42.48a1.1,1.1,0,0,0,1.1,1.1h33V39.28Z"/><circle class="cls-3" cx="37.12" cy="9.3" r="0.93"/><path class="cls-3" d="M40.1,10.22A.93.93,0,0,0,41,9.3a.91.91,0,0,0-.32-.69A.91.91,0,0,0,40,8.29a.93.93,0,0,0-.93.93.91.91,0,0,0,.32.69A.91.91,0,0,0,40.1,10.22Z"/><path class="cls-4" d="M39.71,11.2a3,3,0,0,0-2.85,2.85v6.12h2.33a2.92,2.92,0,0,1,.41.08V15.59a1.26,1.26,0,0,1,1.29-1.23H59.56A1.43,1.43,0,0,1,61,15.79V50.47a1.43,1.43,0,0,1-1.43,1.43H41a1.43,1.43,0,0,1-1.43-1.43V39.28H36.86v7.44H37v9.19a2.63,2.63,0,0,0,2.74,2.63H60.87a2.85,2.85,0,0,0,2.85-2.85V14.05a2.83,2.83,0,0,0-.21-1A2.83,2.83,0,0,0,61,11.42H60v-.1s0-.08-.05-.13H59.9v-.1a.66.66,0,0,0-.12-.29.71.71,0,0,0-.48-.2h-4a.69.69,0,0,0-.66.59s-.05.08-.05.13v.1h-11V11.2H39.71ZM53.26,55.25a1.21,1.21,0,0,1-1.21,1.21H48.2A1.21,1.21,0,0,1,47,55.25v0A1.21,1.21,0,0,1,48.2,54h3.85a1.21,1.21,0,0,1,1.21,1.21Z"/><path class="cls-3" d="M53.63,31.79a3,3,0,0,1,0,4.73L45.77,42.6A3,3,0,0,1,41,40.43L39.6,42.89v7.58A1.43,1.43,0,0,0,41,51.9H59.56A1.43,1.43,0,0,0,61,50.47V15.79a1.43,1.43,0,0,0-1.43-1.43H55.71L48.23,27.61Z"/><path class="cls-5" d="M42.3,23.28v2.36a2.92,2.92,0,0,1,1.65-.56,3,3,0,0,1,1.82.63l2.46,1.9,7.48-13.25H40.89a1.26,1.26,0,0,0-1.29,1.23v4.66A3.08,3.08,0,0,1,42.3,23.28Z"/><path class="cls-5" d="M41,40.23v-1H39.6v3.61L41,40.43C41,40.36,41,40.3,41,40.23Z"/><path class="cls-6" d="M34.53,32.45v3.72a1.78,1.78,0,0,0,1.78,1.78h6v2.29a1.66,1.66,0,0,0,1.67,1.66,1.64,1.64,0,0,0,1-.35l7.86-6.08a1.66,1.66,0,0,0,0-2.63L45,26.76a1.64,1.64,0,0,0-1-.35,1.66,1.66,0,0,0-1.67,1.66v2.6h-6A1.78,1.78,0,0,0,34.53,32.45Z"/><path class="cls-7" d="M33.22,19.22a1.66,1.66,0,0,0-1.67-1.66,1.63,1.63,0,0,0-1,.35L22.69,24a1.66,1.66,0,0,0,0,2.63l7.86,6.08a1.64,1.64,0,0,0,1,.35,1.66,1.66,0,0,0,1.67-1.66v-2.6h6A1.78,1.78,0,0,0,41,27V23.28a1.78,1.78,0,0,0-1.78-1.78h-6Z"/><path class="cls-8" d="M34.55,19.22a3,3,0,0,0-3-3,3,3,0,0,0-1.82.63l-7.86,6.08a3,3,0,0,0,0,4.73l7.86,6.08a3,3,0,0,0,1.82.63,2.92,2.92,0,0,0,1.65-.56v2.36a3.12,3.12,0,0,0,3.11,3.11H41v1c0,.07,0,.13,0,.2a3,3,0,0,0,4.78,2.17l7.86-6.08a3,3,0,0,0,0-4.73l-5.4-4.18-2.46-1.9a3,3,0,0,0-1.82-.63,2.92,2.92,0,0,0-1.65.56V23.28a3.08,3.08,0,0,0-2.7-3,2.92,2.92,0,0,0-.41-.08H34.55Zm7.73,11.46v-2.6a1.66,1.66,0,0,1,1.67-1.66,1.64,1.64,0,0,1,1,.35l7.86,6.08a1.66,1.66,0,0,1,0,2.63L45,41.55a1.64,1.64,0,0,1-1,.35,1.66,1.66,0,0,1-1.67-1.66V37.95h-6a1.78,1.78,0,0,1-1.78-1.78V32.45a1.78,1.78,0,0,1,1.78-1.78ZM39.19,21.5A1.78,1.78,0,0,1,41,23.28V27a1.78,1.78,0,0,1-1.78,1.78h-6v2.6A1.66,1.66,0,0,1,31.55,33a1.64,1.64,0,0,1-1-.35l-7.86-6.08a1.66,1.66,0,0,1,0-2.63l7.86-6.08a1.63,1.63,0,0,1,1-.35,1.66,1.66,0,0,1,1.67,1.66V21.5Z"/><rect class="cls-3" x="47" y="54" width="6.27" height="2.46" rx="1.21" ry="1.21"/></g></svg>

До

Ширина:  |  Высота:  |  Размер: 4.6 KiB

После

Ширина:  |  Высота:  |  Размер: 4.4 KiB

Просмотреть файл

@ -347,21 +347,24 @@
/* Tour Icons */
#onboarding-tour-search,
#onboarding-tour-singlesearch {
background-image: url("img/icons_search.svg");
background-image: url("img/icons_singlesearch.svg");
}
#onboarding-tour-search.onboarding-active,
#onboarding-tour-search:hover,
#onboarding-tour-singlesearch.onboarding-active,
#onboarding-tour-singlesearch:hover {
background-image: url("img/icons_search-colored.svg");
background-image: url("img/icons_singlesearch-colored.svg");
}
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-search] #onboarding-notification-tour-icon,
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-singlesearch] #onboarding-notification-tour-icon {
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-search] #onboarding-notification-tour-icon {
background-image: url("img/icons_search-notification.svg");
}
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-singlesearch] #onboarding-notification-tour-icon {
background-image: url("img/icons_singlesearch-notification.svg");
}
#onboarding-tour-private-browsing {
background-image: url("img/icons_private.svg");
}
@ -429,13 +432,16 @@
}
#onboarding-tour-library {
background-image: url("img/icons_search.svg");
background-image: url("img/icons_library.svg");
}
#onboarding-tour-library.onboarding-active,
#onboarding-tour-library:hover,
#onboarding-tour-library:hover {
background-image: url("img/icons_library-colored.svg");
}
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-library] #onboarding-notification-tour-icon {
background-image: url("img/icons_search-colored.svg");
background-image: url("img/icons_library-notification.svg");
}
#onboarding-tour-performance {
@ -448,9 +454,7 @@
}
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-performance] #onboarding-notification-tour-icon {
/* TODO: Placeholder icon. It should be replaced upon assets are available.
This is tracking in Bug 1382520. */
background-image: url("img/icons_sync-notification.svg");
background-image: url("img/icons_performance-notification.svg");
}
/* Tour Notifications */

Просмотреть файл

@ -261,7 +261,7 @@ var onboardingTourset = {
<p data-l10n-id="onboarding.tour-library.description"></p>
</section>
<section class="onboarding-tour-content">
<img src="resource://onboarding/img/figure_search.svg" role="presentation"/>
<img src="resource://onboarding/img/figure_library.svg" role="presentation"/>
</section>
<aside class="onboarding-tour-button-container">
<button id="onboarding-tour-library-button" class="onboarding-tour-action-button" data-l10n-id="onboarding.tour-library.button"></button>
@ -288,7 +288,7 @@ var onboardingTourset = {
<p data-l10n-id="onboarding.tour-singlesearch.description"></p>
</section>
<section class="onboarding-tour-content">
<img src="resource://onboarding/img/figure_search.svg" role="presentation"/>
<img src="resource://onboarding/img/figure_singlesearch.svg" role="presentation"/>
</section>
<aside class="onboarding-tour-button-container">
<button id="onboarding-tour-singlesearch-button" class="onboarding-tour-action-button" data-l10n-id="onboarding.tour-singlesearch.button"></button>
@ -309,15 +309,13 @@ var onboardingTourset = {
},
getPage(win, bundle) {
let div = win.document.createElement("div");
// TODO: The content image is a placeholder. It should be replaced upon assets are available.
// This is tracking in Bug 1382520.
div.innerHTML = `
<section class="onboarding-tour-description">
<h1 data-l10n-id="onboarding.tour-performance.title"></h1>
<p data-l10n-id="onboarding.tour-performance.description"></p>
</section>
<section class="onboarding-tour-content">
<img src="resource://onboarding/img/figure_sync.svg" role="presentation"/>
<img src="resource://onboarding/img/figure_performance.svg" role="presentation"/>
</section>
`;
return div;

Просмотреть файл

@ -14,7 +14,7 @@
<!ENTITY popupExceptions.label "Exceptions…">
<!ENTITY popupExceptions.accesskey "E">
<!ENTITY permissionSettingsButton.label "Settings">
<!ENTITY permissionSettingsButton2.label "Settings">
<!ENTITY notificationPermissions.label "Notifications">
<!ENTITY notificationSettingsButton.accesskey "n">

Просмотреть файл

@ -18,11 +18,12 @@ function test() {
let result = BrowserUITelemetry._getWindowMeasurements(window, 0);
// Bug 1278176 - DevEdition always reports the developer-button is moved.
Assert.deepEqual(result.defaultMoved, []);
// Bug 1278176 - DevEdition always reports the developer-button is added to
// the toolbar.
if (!AppConstants.MOZ_DEV_EDITION) {
Assert.deepEqual(result.defaultMoved, []);
Assert.deepEqual(result.nondefaultAdded, []);
}
Assert.deepEqual(result.nondefaultAdded, []);
Assert.deepEqual(result.defaultRemoved, []);

Просмотреть файл

@ -12,6 +12,8 @@
--toolbar-non-lwt-bgcolor: var(--toolbar-bgcolor);
--toolbar-non-lwt-textcolor: var(--chrome-color);
--toolbar-non-lwt-bgimage: none;
--tab-line-color: highlight;
}
:root:-moz-lwtheme-brighttext {

Просмотреть файл

@ -6,6 +6,7 @@
:root {
--tab-toolbar-navbar-overlap: 1px;
--tab-line-color: highlight;
--tab-min-height: 33px;
}
@ -17,6 +18,10 @@
--tab-min-height: 41px;
}
:root:-moz-lwtheme {
--tab-line-color: var(--lwt-accent-color);
}
#tabbrowser-tabs,
.tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned] {
min-height: var(--tab-min-height);
@ -305,6 +310,10 @@
border-left-style: solid;
border-right-style: solid;
border-color: var(--tabs-border);
border-image: linear-gradient(var(--tabs-border),
var(--tabs-border) calc(100% - 1px - var(--tab-toolbar-navbar-overlap)),
transparent calc(100% - 1px - var(--tab-toolbar-navbar-overlap)));
border-image-slice: 1;
background-color: var(--toolbar-bgcolor);
background-image: var(--toolbar-bgimage);
background-repeat: repeat-x;
@ -315,7 +324,7 @@
}
.tab-line[selected=true] {
background-color: Highlight;
background-color: var(--tab-line-color);
}
/*

Просмотреть файл

@ -7,9 +7,11 @@
%define glassActiveBorderColor rgb(37, 44, 51)
%define glassInactiveBorderColor rgb(102, 102, 102)
@media not all and (-moz-windows-classic) {
#main-window[sizemode="normal"] > #tab-view-deck > #browser-panel > #navigator-toolbox > #toolbar-menubar {
margin-top: 1px;
@media (-moz-os-version: windows-win7) {
@media not all and (-moz-windows-classic) {
#main-window[sizemode="normal"] > #tab-view-deck > #browser-panel > #navigator-toolbox > #toolbar-menubar {
margin-top: 1px;
}
}
}
@ -81,16 +83,11 @@
.titlebar-button {
border: none;
margin: 0 !important;
padding: 10px 17px;
padding: 8px 17px;
-moz-context-properties: stroke;
stroke: var(--titlebar-text-color);
}
:root[sizemode=maximized] .titlebar-button {
padding-top: 8px;
padding-bottom: 8px;
}
.titlebar-button > .toolbarbutton-icon {
width: 12px;
height: 12px;

Просмотреть файл

@ -289,18 +289,34 @@ function* generateConsoleApiStubs() {
};
let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole");
let {ui} = toolbox.getCurrentPanel().hud;
const hud = toolbox.getCurrentPanel().hud;
let {ui} = hud;
ok(ui.jsterm, "jsterm exists");
ok(ui.newConsoleOutput, "newConsoleOutput exists");
for (let [key, {keys, code}] of consoleApi) {
let received = new Promise(resolve => {
let i = 0;
let listener = (type, res) => {
stubs.packets.push(formatPacket(keys[i], res));
stubs.preparedMessages.push(formatStub(keys[i], res));
let listener = async (type, res) => {
const callKey = keys[i];
stubs.packets.push(formatPacket(callKey, res));
stubs.preparedMessages.push(formatStub(callKey, res));
if (++i === keys.length) {
toolbox.target.client.removeListener("consoleAPICall", listener);
// If this is a console.dir call, we need to wait for the properties
// to be fetched so we don't have any server errors.
if (callKey === "console.dir({C, M, Y, K})") {
const dirMsg = await waitForMessage(hud, `cyan: "C"`);
const oi = dirMsg.querySelector(".tree");
// If there's only one node, it means that the object inspector
// is not expanded.
if (oi.querySelectorAll(".node").length === 1) {
await waitForNodeMutation(oi, {
childList: true
});
}
}
resolve();
}
};
@ -506,3 +522,44 @@ function* generatePageErrorStubs() {
yield closeTabAndToolbox();
return formatFile(stubs, "ConsoleMessage");
}
/**
* Wait for messages in the web console output, resolving once they are receieved.
*
* @param hud: the webconsole
* @param message: string. text match in .message-body
*/
function waitForMessage(hud, messageText) {
return new Promise(resolve => {
hud.ui.on("new-messages",
function messagesReceived(e, newMessages) {
for (let newMessage of newMessages) {
let messageBody = newMessage.node.querySelector(".message-body");
if (messageBody.textContent.includes(messageText)) {
info("Matched a message with text: " + messageText);
hud.ui.off("new-messages", messagesReceived);
resolve(newMessage.node);
break;
}
}
});
});
}
/**
* Returns a promise that resolves when the node passed as an argument mutate
* according to the passed configuration.
*
* @param {Node} node - The node to observe mutations on.
* @param {Object} observeConfig - A configuration object for MutationObserver.observe.
* @returns {Promise}
*/
function waitForNodeMutation(node, observeConfig = {}) {
return new Promise(resolve => {
const observer = new MutationObserver(mutations => {
resolve(mutations);
observer.disconnect();
});
observer.observe(node, observeConfig);
});
}

Просмотреть файл

@ -13,6 +13,9 @@
"use strict";
const testcases = [
{
property: "-moz-appearance",
},
{
property: "-moz-border-bottom-colors",
},

Просмотреть файл

@ -312,7 +312,7 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
nsMargin rootMargin;
NS_FOR_CSS_SIDES(side) {
nscoord basis = side == eSideTop || side == eSideBottom ?
rootRect.height : rootRect.width;
rootRect.Height() : rootRect.Width();
nsCSSValue value = mRootMargin.*nsCSSRect::sides[side];
nsStyleCoord coord;
if (value.IsPixelLengthUnit()) {
@ -422,9 +422,9 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
}
}
double targetArea = targetRect.width * targetRect.height;
double targetArea = targetRect.Width() * targetRect.Height();
double intersectionArea = !intersectionRect ?
0 : intersectionRect->width * intersectionRect->height;
0 : intersectionRect->Width() * intersectionRect->Height();
double intersectionRatio;
if (targetArea > 0.0) {

Просмотреть файл

@ -980,7 +980,7 @@ Element::ScrollHeight()
nsIScrollableFrame* sf = GetScrollFrame();
nscoord height;
if (sf) {
height = sf->GetScrollRange().height + sf->GetScrollPortRect().height;
height = sf->GetScrollRange().Height() + sf->GetScrollPortRect().Height();
} else {
height = GetScrollRectSizeForOverflowVisibleFrame(GetStyledFrame()).height;
}
@ -997,7 +997,7 @@ Element::ScrollWidth()
nsIScrollableFrame* sf = GetScrollFrame();
nscoord width;
if (sf) {
width = sf->GetScrollRange().width + sf->GetScrollPortRect().width;
width = sf->GetScrollRange().Width() + sf->GetScrollPortRect().Width();
} else {
width = GetScrollRectSizeForOverflowVisibleFrame(GetStyledFrame()).width;
}

Просмотреть файл

@ -1062,11 +1062,11 @@ public:
}
int32_t ClientWidth()
{
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().width);
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().Width());
}
int32_t ClientHeight()
{
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().height);
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().Height());
}
int32_t ScrollTopMin()
{

Просмотреть файл

@ -23,6 +23,7 @@
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStates.h"
#include "mozilla/HTMLEditor.h"
#include "mozilla/ServoRestyleManager.h"
#include "mozilla/TextEditor.h"
#include "mozilla/URLExtraData.h"
@ -271,12 +272,12 @@ nsIContent::GetDesiredIMEState()
if (!pc) {
return IMEState(IMEState::DISABLED);
}
nsIEditor* editor = nsContentUtils::GetHTMLEditor(pc);
if (!editor) {
HTMLEditor* htmlEditor = nsContentUtils::GetHTMLEditor(pc);
if (!htmlEditor) {
return IMEState(IMEState::DISABLED);
}
IMEState state;
editor->GetPreferredIMEState(&state);
htmlEditor->GetPreferredIMEState(&state);
return state;
}

Просмотреть файл

@ -13,6 +13,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/EventStates.h"
#include "mozilla/HTMLEditor.h"
#include "nsCOMPtr.h"
#include "nsString.h"
@ -73,8 +74,6 @@
#include "mozilla/layers/ScrollInputMethods.h"
#include "nsViewManager.h"
#include "nsIEditor.h"
#include "nsIHTMLEditor.h"
#include "nsFocusManager.h"
#include "nsPIDOMWindow.h"
@ -3360,8 +3359,8 @@ Selection::GetWindow() const
return document ? document->GetWindow() : nullptr;
}
nsIEditor*
Selection::GetEditor() const
HTMLEditor*
Selection::GetHTMLEditor() const
{
nsPresContext* presContext = GetPresContext();
if (!presContext) {
@ -3483,9 +3482,9 @@ Selection::GetSelectionEndPointGeometry(SelectionRegion aRegion, nsRect* aRect)
aRect->x = pt.x;
} else if (mFrameSelection->GetHint() == CARET_ASSOCIATE_BEFORE) {
// It's the frame's right edge we're interested in.
aRect->x = frame->GetRect().width;
aRect->x = frame->GetRect().Width();
}
aRect->height = frame->GetRect().height;
aRect->SetHeight(frame->GetRect().Height());
return frame;
}
@ -3747,7 +3746,7 @@ Selection::NotifySelectionListeners()
// If the document is in design mode or doesn't have contenteditable
// element, we don't need to move focus.
if (window && document && !document->HasFlag(NODE_IS_EDITABLE) &&
GetEditor()) {
GetHTMLEditor()) {
RefPtr<Element> newEditingHost = GetCommonEditingHostForAllRanges();
nsFocusManager* fm = nsFocusManager::GetFocusManager();
nsCOMPtr<nsPIDOMWindowOuter> focusedWindow;

Просмотреть файл

@ -24,9 +24,7 @@ struct CachedOffsetForFrame;
class nsAutoScrollTimer;
class nsIContentIterator;
class nsIDocument;
class nsIEditor;
class nsIFrame;
class nsIHTMLEditor;
class nsFrameSelection;
class nsPIDOMWindowOuter;
struct SelectionDetails;
@ -36,6 +34,7 @@ class nsHTMLCopyEncoder;
namespace mozilla {
class ErrorResult;
class HTMLEditor;
struct AutoPrepareFocusRange;
} // namespace mozilla
@ -393,7 +392,7 @@ private:
nsIDocument* GetDocument() const;
nsPIDOMWindowOuter* GetWindow() const;
nsIEditor* GetEditor() const;
HTMLEditor* GetHTMLEditor() const;
/**
* GetCommonEditingHostForAllRanges() returns common editing host of all

Просмотреть файл

@ -1259,7 +1259,7 @@ nsContentSink::StartLayout(bool aIgnorePendingSheets)
if (shell && !shell->DidInitialize()) {
nsRect r = shell->GetPresContext()->GetVisibleArea();
nsCOMPtr<nsIPresShell> shellGrip = shell;
nsresult rv = shell->Initialize(r.width, r.height);
nsresult rv = shell->Initialize(r.Width(), r.Height());
if (NS_FAILED(rv)) {
return;
}

Просмотреть файл

@ -65,6 +65,7 @@
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/gfx/DataSurfaceHelpers.h"
#include "mozilla/HTMLEditor.h"
#include "mozilla/IMEStateManager.h"
#include "mozilla/InternalMutationEvent.h"
#include "mozilla/Likely.h"
@ -137,7 +138,6 @@
#include "nsIDOMNodeList.h"
#include "nsIDOMWindowUtils.h"
#include "nsIDragService.h"
#include "nsIEditor.h"
#include "nsIFormControl.h"
#include "nsIForm.h"
#include "nsIFragmentContentSink.h"
@ -7552,7 +7552,7 @@ nsContentUtils::GetSelectionInTextControl(Selection* aSelection,
}
nsIEditor*
HTMLEditor*
nsContentUtils::GetHTMLEditor(nsPresContext* aPresContext)
{
nsCOMPtr<nsIDocShell> docShell(aPresContext->GetDocShell());
@ -7561,9 +7561,7 @@ nsContentUtils::GetHTMLEditor(nsPresContext* aPresContext)
NS_FAILED(docShell->GetEditable(&isEditable)) || !isEditable)
return nullptr;
nsCOMPtr<nsIEditor> editor;
docShell->GetEditor(getter_AddRefs(editor));
return editor;
return docShell->GetHTMLEditor();
}
bool

Просмотреть файл

@ -71,7 +71,6 @@ class nsIDOMHTMLInputElement;
class nsIDOMKeyEvent;
class nsIDOMNode;
class nsIDragSession;
class nsIEditor;
class nsIEventTarget;
class nsIFragmentContentSink;
class nsIFrame;
@ -127,6 +126,7 @@ namespace mozilla {
class Dispatcher;
class ErrorResult;
class EventListenerManager;
class HTMLEditor;
namespace dom {
struct CustomElementDefinition;
@ -2623,7 +2623,13 @@ public:
static int32_t GetAdjustedOffsetInTextControl(nsIFrame* aOffsetFrame,
int32_t aOffset);
static nsIEditor* GetHTMLEditor(nsPresContext* aPresContext);
/**
* Returns pointer to HTML editor instance for the aPresContext when there is.
* The HTML editor is shared by contenteditable elements or used in
* designMode. When there are no contenteditable elements and the document
* is not in designMode, this returns nullptr.
*/
static mozilla::HTMLEditor* GetHTMLEditor(nsPresContext* aPresContext);
/**
* Returns true if the browser.dom.window.dump.enabled pref is set.

Просмотреть файл

@ -1896,8 +1896,8 @@ nsDOMWindowUtils::GetRootBounds(nsIDOMClientRect** aResult)
nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable();
if (sf) {
bounds = sf->GetScrollRange();
bounds.width += sf->GetScrollPortRect().width;
bounds.height += sf->GetScrollPortRect().height;
bounds.SetWidth(bounds.Width() + sf->GetScrollPortRect().Width());
bounds.SetHeight(bounds.Height() + sf->GetScrollPortRect().Height());
} else if (presShell->GetRootFrame()) {
bounds = presShell->GetRootFrame()->GetRect();
}
@ -1907,8 +1907,8 @@ nsDOMWindowUtils::GetRootBounds(nsIDOMClientRect** aResult)
RefPtr<DOMRect> rect = new DOMRect(window);
rect->SetRect(nsPresContext::AppUnitsToFloatCSSPixels(bounds.x),
nsPresContext::AppUnitsToFloatCSSPixels(bounds.y),
nsPresContext::AppUnitsToFloatCSSPixels(bounds.width),
nsPresContext::AppUnitsToFloatCSSPixels(bounds.height));
nsPresContext::AppUnitsToFloatCSSPixels(bounds.Width()),
nsPresContext::AppUnitsToFloatCSSPixels(bounds.Height()));
rect.forget(aResult);
return NS_OK;
}

Просмотреть файл

@ -2632,7 +2632,7 @@ nsGlobalWindow::SetInitialPrincipalToSubject()
// Ensure that if someone plays with this document they will get
// layout happening.
nsRect r = shell->GetPresContext()->GetVisibleArea();
shell->Initialize(r.width, r.height);
shell->Initialize(r.Width(), r.Height());
}
}
@ -5746,7 +5746,7 @@ nsGlobalWindow::SetInnerWidthOuter(int32_t aInnerWidth,
presContext = presShell->GetPresContext();
nsRect shellArea = presContext->GetVisibleArea();
height = shellArea.height;
height = shellArea.Height();
SetCSSViewportWidthAndHeight(nsPresContext::CSSPixelsToAppUnits(aInnerWidth),
height);
return;
@ -5840,7 +5840,7 @@ nsGlobalWindow::SetInnerHeightOuter(int32_t aInnerHeight,
nsRect shellArea = presContext->GetVisibleArea();
nscoord height = aInnerHeight;
nscoord width = shellArea.width;
nscoord width = shellArea.Width();
CheckSecurityWidthAndHeight(nullptr, &height, aCallerType);
SetCSSViewportWidthAndHeight(width,
nsPresContext::CSSPixelsToAppUnits(height));
@ -6460,8 +6460,8 @@ nsGlobalWindow::SetCSSViewportWidthAndHeight(nscoord aInnerWidth, nscoord aInner
mDocShell->GetPresContext(getter_AddRefs(presContext));
nsRect shellArea = presContext->GetVisibleArea();
shellArea.height = aInnerHeight;
shellArea.width = aInnerWidth;
shellArea.SetHeight(aInnerHeight);
shellArea.SetWidth(aInnerWidth);
presContext->SetVisibleArea(shellArea);
}

Просмотреть файл

@ -62,7 +62,6 @@
#include "nsIDOMEventListener.h"
#include "nsIDOMMutationEvent.h"
#include "nsIDOMNodeList.h"
#include "nsIEditor.h"
#include "nsILinkHandler.h"
#include "mozilla/dom/NodeInfo.h"
#include "mozilla/dom/NodeInfoInlines.h"
@ -225,14 +224,6 @@ nsINode::IsEditableInternal() const
return doc && doc->HasFlag(NODE_IS_EDITABLE);
}
static nsIContent* GetEditorRootContent(nsIEditor* aEditor)
{
nsCOMPtr<nsIDOMElement> rootElement;
aEditor->GetRootElement(getter_AddRefs(rootElement));
nsCOMPtr<nsIContent> rootContent(do_QueryInterface(rootElement));
return rootContent;
}
nsIContent*
nsINode::GetTextEditorRootContent(TextEditor** aTextEditor)
{
@ -366,13 +357,13 @@ nsINode::GetSelectionRootContent(nsIPresShell* aPresShell)
nsPresContext* presContext = aPresShell->GetPresContext();
if (presContext) {
nsIEditor* editor = nsContentUtils::GetHTMLEditor(presContext);
if (editor) {
HTMLEditor* htmlEditor = nsContentUtils::GetHTMLEditor(presContext);
if (htmlEditor) {
// This node is in HTML editor.
nsIDocument* doc = GetComposedDoc();
if (!doc || doc->HasFlag(NODE_IS_EDITABLE) ||
!HasFlag(NODE_IS_EDITABLE)) {
nsIContent* editorRoot = GetEditorRootContent(editor);
nsIContent* editorRoot = htmlEditor->GetRoot();
NS_ENSURE_TRUE(editorRoot, nullptr);
return nsContentUtils::IsInSameAnonymousTree(this, editorRoot) ?
editorRoot :

Просмотреть файл

@ -133,7 +133,7 @@ nsQueryContentEventResult::GetWidth(int32_t *aWidth)
NS_ENSURE_TRUE(mSucceeded, NS_ERROR_NOT_AVAILABLE);
NS_ENSURE_TRUE(IsRectRelatedPropertyAvailable(mEventMessage),
NS_ERROR_NOT_AVAILABLE);
*aWidth = mRect.width;
*aWidth = mRect.Width();
return NS_OK;
}
@ -153,7 +153,7 @@ nsQueryContentEventResult::GetHeight(int32_t *aHeight)
NS_ENSURE_TRUE(mSucceeded, NS_ERROR_NOT_AVAILABLE);
NS_ENSURE_TRUE(IsRectRelatedPropertyAvailable(mEventMessage),
NS_ERROR_NOT_AVAILABLE);
*aHeight = mRect.height;
*aHeight = mRect.Height();
return NS_OK;
}
@ -216,8 +216,8 @@ nsQueryContentEventResult::GetCharacterRect(int32_t aOffset,
*aLeft = mRectArray[aOffset].x;
*aTop = mRectArray[aOffset].y;
*aWidth = mRectArray[aOffset].width;
*aHeight = mRectArray[aOffset].height;
*aWidth = mRectArray[aOffset].Width();
*aHeight = mRectArray[aOffset].Height();
return NS_OK;
}

Просмотреть файл

@ -3082,7 +3082,7 @@ static void ExtractRectFromOffset(nsIFrame* aFrame,
aFrame->GetPointFromOffset(aOffset, &point);
if (!aClampToEdge && !aR->Contains(point)) {
aR->width = 0;
aR->SetWidth(0);
aR->x = point.x;
return;
}
@ -3092,9 +3092,9 @@ static void ExtractRectFromOffset(nsIFrame* aFrame,
}
if (aKeepLeft) {
aR->width = point.x - aR->x;
aR->SetWidth(point.x - aR->x);
} else {
aR->width = aR->XMost() - point.x;
aR->SetWidth(aR->XMost() - point.x);
aR->x = point.x;
}
}
@ -3224,7 +3224,7 @@ nsRange::CollectClientRectsAndText(nsLayoutUtils::RectCallback* aCollector,
nsRect r = outFrame->GetRectRelativeToSelf();
ExtractRectFromOffset(outFrame, static_cast<int32_t>(aStartOffset),
&r, false, aClampToEdge);
r.width = 0;
r.SetWidth(0);
r = nsLayoutUtils::TransformFrameRectToAncestor(outFrame, r, relativeTo);
aCollector->AddRect(r);
}

Просмотреть файл

@ -137,8 +137,8 @@ nsScreen::GetRect(nsRect& aRect)
aRect.x = NSToIntRound(screenTopLeftDesk.x);
aRect.y = NSToIntRound(screenTopLeftDesk.y);
aRect.height = nsPresContext::AppUnitsToIntCSSPixels(aRect.height);
aRect.width = nsPresContext::AppUnitsToIntCSSPixels(aRect.width);
aRect.SetHeight(nsPresContext::AppUnitsToIntCSSPixels(aRect.Height()));
aRect.SetWidth(nsPresContext::AppUnitsToIntCSSPixels(aRect.Width()));
return NS_OK;
}
@ -172,8 +172,8 @@ nsScreen::GetAvailRect(nsRect& aRect)
aRect.y = NSToIntRound(screenTopLeftDesk.y) +
nsPresContext::AppUnitsToIntCSSPixels(aRect.y - r.y);
aRect.height = nsPresContext::AppUnitsToIntCSSPixels(aRect.height);
aRect.width = nsPresContext::AppUnitsToIntCSSPixels(aRect.width);
aRect.SetHeight(nsPresContext::AppUnitsToIntCSSPixels(aRect.Height()));
aRect.SetWidth(nsPresContext::AppUnitsToIntCSSPixels(aRect.Width()));
return NS_OK;
}

Просмотреть файл

@ -62,7 +62,7 @@ public:
}
aRv = GetRect(rect);
return rect.width;
return rect.Width();
}
int32_t GetHeight(ErrorResult& aRv)
@ -77,7 +77,7 @@ public:
}
aRv = GetRect(rect);
return rect.height;
return rect.Height();
}
int32_t GetPixelDepth(ErrorResult& aRv);
@ -104,14 +104,14 @@ public:
{
nsRect rect;
aRv = GetAvailRect(rect);
return rect.width;
return rect.Width();
}
int32_t GetAvailHeight(ErrorResult& aRv)
{
nsRect rect;
aRv = GetAvailRect(rect);
return rect.height;
return rect.Height();
}
// Deprecated

Просмотреть файл

@ -477,11 +477,24 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
(sContent != aContent || sPresContext != aPresContext ||
oldWidget != newWidget || sActiveTabParent != newTabParent);
if (oldWidget && focusActuallyChanging) {
// If we're deactivating, we shouldn't commit composition forcibly because
// the user may want to continue the composition.
if (aPresContext) {
NotifyIME(REQUEST_TO_COMMIT_COMPOSITION, oldWidget, sFocusedIMETabParent);
// If old widget has composition, we may need to commit composition since
// a native IME context is shared on all editors on some widgets or all
// widgets (it depends on platforms).
if (oldWidget && focusActuallyChanging && sTextCompositions) {
RefPtr<TextComposition> composition =
sTextCompositions->GetCompositionFor(oldWidget);
if (composition) {
// However, don't commit the composition if we're being inactivated
// but the composition should be kept even during deactive.
if (aPresContext ||
!sFocusedIMEWidget->IMENotificationRequestsRef().
WantDuringDeactive()) {
MOZ_LOG(sISMLog, LogLevel::Info,
(" OnChangeFocusInternal(), requesting to commit composition to "
"the (previous) focused widget"));
NotifyIME(REQUEST_TO_COMMIT_COMPOSITION, oldWidget,
composition->GetTabParent());
}
}
}

Просмотреть файл

@ -160,6 +160,46 @@ Touch::ScreenY(CallerType aCallerType) const
return mScreenPoint.y;
}
int32_t
Touch::RadiusX(CallerType aCallerType) const
{
if (nsContentUtils::ResistFingerprinting(aCallerType)) {
return 0;
}
return mRadius.x;
}
int32_t
Touch::RadiusY(CallerType aCallerType) const
{
if (nsContentUtils::ResistFingerprinting(aCallerType)) {
return 0;
}
return mRadius.y;
}
float
Touch::RotationAngle(CallerType aCallerType) const
{
if (nsContentUtils::ResistFingerprinting(aCallerType)) {
return 0.0f;
}
return mRotationAngle;
}
float
Touch::Force(CallerType aCallerType) const
{
if (nsContentUtils::ResistFingerprinting(aCallerType)) {
return 0.0f;
}
return mForce;
}
void
Touch::InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent)
{
@ -184,10 +224,10 @@ bool
Touch::Equals(Touch* aTouch)
{
return mRefPoint == aTouch->mRefPoint &&
mForce == aTouch->Force() &&
mRotationAngle == aTouch->RotationAngle() &&
mRadius.x == aTouch->RadiusX() &&
mRadius.y == aTouch->RadiusY();
mForce == aTouch->mForce &&
mRotationAngle == aTouch->mRotationAngle &&
mRadius.x == aTouch->mRadius.x &&
mRadius.y == aTouch->mRadius.y;
}
JSObject*

Просмотреть файл

@ -74,10 +74,10 @@ public:
int32_t ClientY() const { return mClientPoint.y; }
int32_t PageX() const { return mPagePoint.x; }
int32_t PageY() const { return mPagePoint.y; }
int32_t RadiusX() const { return mRadius.x; }
int32_t RadiusY() const { return mRadius.y; }
float RotationAngle() const { return mRotationAngle; }
float Force() const { return mForce; }
int32_t RadiusX(CallerType aCallerType) const;
int32_t RadiusY(CallerType aCallerType) const;
float RotationAngle(CallerType aCallerType) const;
float Force(CallerType aCallerType) const;
nsCOMPtr<EventTarget> mTarget;
LayoutDeviceIntPoint mRefPoint;

Просмотреть файл

@ -7,6 +7,7 @@
#include "HTMLBodyElement.h"
#include "mozilla/dom/HTMLBodyElementBinding.h"
#include "mozilla/GenericSpecifiedValuesInlines.h"
#include "mozilla/HTMLEditor.h"
#include "mozilla/TextEditor.h"
#include "nsAttrValueInlines.h"
#include "nsGkAtoms.h"
@ -15,7 +16,6 @@
#include "nsIPresShell.h"
#include "nsIDocument.h"
#include "nsHTMLStyleSheet.h"
#include "nsIEditor.h"
#include "nsMappedAttributes.h"
#include "nsIDocShell.h"
#include "nsRuleWalker.h"
@ -392,7 +392,7 @@ HTMLBodyElement::IsAttributeMapped(const nsIAtom* aAttribute) const
return FindAttributeDependence(aAttribute, map);
}
already_AddRefed<nsIEditor>
already_AddRefed<TextEditor>
HTMLBodyElement::GetAssociatedEditor()
{
RefPtr<TextEditor> textEditor = GetTextEditorInternal();
@ -416,9 +416,8 @@ HTMLBodyElement::GetAssociatedEditor()
return nullptr;
}
nsCOMPtr<nsIEditor> editor;
docShell->GetEditor(getter_AddRefs(editor));
return editor.forget();
RefPtr<HTMLEditor> htmlEditor = docShell->GetHTMLEditor();
return htmlEditor.forget();
}
bool

Просмотреть файл

@ -12,6 +12,9 @@
#include "nsIStyleRule.h"
namespace mozilla {
class TextEditor;
namespace dom {
class OnBeforeUnloadEventHandlerNonNull;
@ -105,7 +108,7 @@ public:
nsAttrValue& aResult) override;
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const override;
virtual already_AddRefed<nsIEditor> GetAssociatedEditor() override;
virtual already_AddRefed<TextEditor> GetAssociatedEditor() override;
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
bool aPreallocateChildren) const override;

Просмотреть файл

@ -76,7 +76,6 @@
#include "mozilla/InternalMutationEvent.h"
#include "nsDOMStringMap.h"
#include "nsIEditor.h"
#include "nsLayoutUtils.h"
#include "mozAutoDocUpdate.h"
#include "nsHtml5Module.h"
@ -2659,7 +2658,7 @@ nsGenericHTMLElement::DispatchSimulatedClick(nsGenericHTMLElement* aElement,
return EventDispatcher::Dispatch(ToSupports(aElement), aPresContext, &event);
}
already_AddRefed<nsIEditor>
already_AddRefed<TextEditor>
nsGenericHTMLElement::GetAssociatedEditor()
{
// If contenteditable is ever implemented, it might need to do something different here?
@ -2695,9 +2694,9 @@ nsGenericHTMLElement::SyncEditorsOnSubtree(nsIContent* content)
/* Sync this node */
nsGenericHTMLElement* element = FromContent(content);
if (element) {
nsCOMPtr<nsIEditor> editor = element->GetAssociatedEditor();
if (editor) {
editor->SyncRealTimeSpell();
RefPtr<TextEditor> textEditor = element->GetAssociatedEditor();
if (textEditor) {
textEditor->SyncRealTimeSpell();
}
}

Просмотреть файл

@ -23,7 +23,6 @@
class nsDOMTokenList;
class nsIDOMHTMLMenuElement;
class nsIEditor;
class nsIFormControlFrame;
class nsIFrame;
class nsILayoutHistoryState;
@ -230,14 +229,14 @@ public:
mozilla::CSSIntRect rcFrame;
GetOffsetRect(rcFrame);
return rcFrame.width;
return rcFrame.Width();
}
int32_t OffsetHeight()
{
mozilla::CSSIntRect rcFrame;
GetOffsetRect(rcFrame);
return rcFrame.height;
return rcFrame.Height();
}
// These methods are already implemented in nsIContent but we want something
@ -916,14 +915,14 @@ protected:
}
/**
* Locates the nsIEditor associated with this node. In general this is
* Locates the TextEditor associated with this node. In general this is
* equivalent to GetEditorInternal(), but for designmode or contenteditable,
* this may need to get an editor that's not actually on this element's
* associated TextControlFrame. This is used by the spellchecking routines
* to get the editor affected by changing the spellcheck attribute on this
* node.
*/
virtual already_AddRefed<nsIEditor> GetAssociatedEditor();
virtual already_AddRefed<mozilla::TextEditor> GetAssociatedEditor();
/**
* Get the frame's offset information for offsetTop/Left/Width/Height.

Просмотреть файл

@ -84,12 +84,11 @@
#include "mozilla/dom/FallbackEncoding.h"
#include "mozilla/Encoding.h"
#include "mozilla/HTMLEditor.h"
#include "mozilla/LoadInfo.h"
#include "nsIEditingSession.h"
#include "nsIEditor.h"
#include "nsNodeInfoManager.h"
#include "nsIPlaintextEditor.h"
#include "nsIHTMLEditor.h"
#include "nsIEditorStyleSheets.h"
#include "nsIInlineSpellChecker.h"
#include "nsRange.h"
@ -2613,9 +2612,8 @@ nsHTMLDocument::DeferredContentEditableCountChange(nsIContent *aElement)
if (!docshell)
return;
nsCOMPtr<nsIEditor> editor;
docshell->GetEditor(getter_AddRefs(editor));
if (editor) {
RefPtr<HTMLEditor> htmlEditor = docshell->GetHTMLEditor();
if (htmlEditor) {
RefPtr<nsRange> range = new nsRange(aElement);
rv = range->SelectNode(node);
if (NS_FAILED(rv)) {
@ -2626,8 +2624,8 @@ nsHTMLDocument::DeferredContentEditableCountChange(nsIContent *aElement)
}
nsCOMPtr<nsIInlineSpellChecker> spellChecker;
rv = editor->GetInlineSpellChecker(false,
getter_AddRefs(spellChecker));
rv = htmlEditor->GetInlineSpellChecker(false,
getter_AddRefs(spellChecker));
NS_ENSURE_SUCCESS_VOID(rv);
if (spellChecker) {
@ -2661,7 +2659,7 @@ NotifyEditableStateChange(nsINode *aNode, nsIDocument *aDocument)
}
void
nsHTMLDocument::TearingDownEditor(nsIEditor *aEditor)
nsHTMLDocument::TearingDownEditor()
{
if (IsEditingOn()) {
EditingState oldState = mEditingState;
@ -2774,17 +2772,12 @@ nsHTMLDocument::EditingStateChanged()
nsresult rv = docshell->GetEditingSession(getter_AddRefs(editSession));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIEditor> existingEditor;
editSession->GetEditorForWindow(window, getter_AddRefs(existingEditor));
if (existingEditor) {
RefPtr<HTMLEditor> htmlEditor = editSession->GetHTMLEditorForWindow(window);
if (htmlEditor) {
// We might already have an editor if it was set up for mail, let's see
// if this is actually the case.
#ifdef DEBUG
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(existingEditor);
MOZ_ASSERT(htmlEditor, "If we have an editor, it must be an HTML editor");
#endif
uint32_t flags = 0;
existingEditor->GetFlags(&flags);
htmlEditor->GetFlags(&flags);
if (flags & nsIPlaintextEditor::eEditorMailMask) {
// We already have a mail editor, then we should not attempt to create
// another one.
@ -2802,7 +2795,7 @@ nsHTMLDocument::EditingStateChanged()
bool updateState = false;
bool spellRecheckAll = false;
bool putOffToRemoveScriptBlockerUntilModifyingEditingState = false;
nsCOMPtr<nsIEditor> editor;
htmlEditor = nullptr;
{
EditingState oldState = mEditingState;
@ -2886,14 +2879,15 @@ nsHTMLDocument::EditingStateChanged()
}
// XXX Need to call TearDownEditorOnWindow for all failures.
docshell->GetEditor(getter_AddRefs(editor));
if (!editor)
htmlEditor = docshell->GetHTMLEditor();
if (!htmlEditor) {
return NS_ERROR_FAILURE;
}
// If we're entering the design mode, put the selection at the beginning of
// the document for compatibility reasons.
if (designMode && oldState == eOff) {
editor->BeginningOfDocument();
htmlEditor->BeginningOfDocument();
}
if (putOffToRemoveScriptBlockerUntilModifyingEditingState) {
@ -2945,18 +2939,21 @@ nsHTMLDocument::EditingStateChanged()
// Resync the editor's spellcheck state.
if (spellRecheckAll) {
nsCOMPtr<nsISelectionController> selcon;
nsresult rv = editor->GetSelectionController(getter_AddRefs(selcon));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsISelectionController> selectionController =
htmlEditor->GetSelectionController();
if (NS_WARN_IF(!selectionController)) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsISelection> spellCheckSelection;
rv = selcon->GetSelection(nsISelectionController::SELECTION_SPELLCHECK,
getter_AddRefs(spellCheckSelection));
rv = selectionController->GetSelection(
nsISelectionController::SELECTION_SPELLCHECK,
getter_AddRefs(spellCheckSelection));
if (NS_SUCCEEDED(rv)) {
spellCheckSelection->RemoveAllRanges();
}
}
editor->SyncRealTimeSpell();
htmlEditor->SyncRealTimeSpell();
return NS_OK;
}

Просмотреть файл

@ -22,7 +22,6 @@
#include "mozilla/dom/HTMLSharedElement.h"
#include "mozilla/dom/BindingDeclarations.h"
class nsIEditor;
class nsIURI;
class nsIDocShell;
class nsICachingChannel;
@ -105,7 +104,7 @@ public:
virtual void AddedForm() override;
virtual void RemovedForm() override;
virtual int32_t GetNumFormsSynchronous() override;
virtual void TearingDownEditor(nsIEditor *aEditor) override;
virtual void TearingDownEditor() override;
virtual void SetIsXHTML(bool aXHTML) override
{
mType = (aXHTML ? eXHTML : eHTML);

Просмотреть файл

@ -11,7 +11,6 @@
#include "nsCompatibility.h"
class nsIContent;
class nsIEditor;
class nsContentList;
#define NS_IHTMLDOCUMENT_IID \
@ -112,7 +111,7 @@ public:
/**
* Called when this nsIHTMLDocument's editor is destroyed.
*/
virtual void TearingDownEditor(nsIEditor *aEditor) = 0;
virtual void TearingDownEditor() = 0;
virtual void SetIsXHTML(bool aXHTML) = 0;

Просмотреть файл

@ -261,7 +261,7 @@ public:
nsIntRect ImageRect() const
{
if (mImageRect.width < 0 || mImageRect.height < 0) {
if (mImageRect.Width() < 0 || mImageRect.Height() < 0) {
return nsIntRect(0, 0, mImage.width, mImage.height);
}
return mImageRect;
@ -290,8 +290,8 @@ public:
nsIntRect imageRect = ImageRect();
imageRect.x = (imageRect.x * aWidth) / mImage.width;
imageRect.y = (imageRect.y * aHeight) / mImage.height;
imageRect.width = (aWidth * imageRect.width) / mImage.width;
imageRect.height = (aHeight * imageRect.height) / mImage.height;
imageRect.SetWidth((aWidth * imageRect.Width()) / mImage.width);
imageRect.SetHeight((aHeight * imageRect.Height()) / mImage.height);
return imageRect;
}

Просмотреть файл

@ -38,8 +38,12 @@ interface Touch {
readonly attribute long clientY;
readonly attribute long pageX;
readonly attribute long pageY;
[NeedsCallerType]
readonly attribute long radiusX;
[NeedsCallerType]
readonly attribute long radiusY;
[NeedsCallerType]
readonly attribute float rotationAngle;
[NeedsCallerType]
readonly attribute float force;
};

Просмотреть файл

@ -8,6 +8,7 @@
#include "imgIContainer.h" // for imgIContainer, etc
#include "mozilla/FlushType.h" // for FlushType::Frames
#include "mozilla/HTMLEditor.h" // for HTMLEditor
#include "mozilla/mozalloc.h" // for operator new
#include "nsAString.h"
#include "nsComponentManagerUtils.h" // for do_CreateInstance
@ -49,12 +50,15 @@
#include "nsPresContext.h" // for nsPresContext
#include "nsReadableUtils.h" // for AppendUTF16toUTF8
#include "nsStringFwd.h" // for nsString
#include "mozilla/dom/Selection.h" // for AutoHideSelectionChanges
#include "mozilla/dom/Selection.h" // for AutoHideSelectionChanges, etc
#include "nsFrameSelection.h" // for nsFrameSelection
class nsISupports;
class nsIURI;
using namespace mozilla;
using namespace mozilla::dom;
/*---------------------------------------------------------------------------
nsEditingSession
@ -348,7 +352,6 @@ nsEditingSession::SetupEditorOnWindow(mozIDOMWindowProxy* aWindow)
}
bool needHTMLController = false;
const char *classString = "@mozilla.org/editor/htmleditor;1";
if (mEditorType.EqualsLiteral("textmail")) {
mEditorFlags = nsIPlaintextEditor::eEditorPlaintextMask |
nsIPlaintextEditor::eEditorEnableWrapHackMask |
@ -408,33 +411,36 @@ nsEditingSession::SetupEditorOnWindow(mozIDOMWindowProxy* aWindow)
// from web pages.
RefPtr<nsFrameSelection> fs = presShell->FrameSelection();
NS_ENSURE_TRUE(fs, NS_ERROR_FAILURE);
mozilla::dom::AutoHideSelectionChanges hideSelectionChanges(fs);
AutoHideSelectionChanges hideSelectionChanges(fs);
// create and set editor
// Try to reuse an existing editor
nsCOMPtr<nsIEditor> editor = do_QueryReferent(mExistingEditor);
if (editor) {
editor->PreDestroy(false);
RefPtr<HTMLEditor> htmlEditor = editor ? editor->AsHTMLEditor() : nullptr;
MOZ_ASSERT(!editor || htmlEditor);
if (htmlEditor) {
htmlEditor->PreDestroy(false);
} else {
editor = do_CreateInstance(classString, &rv);
NS_ENSURE_SUCCESS(rv, rv);
mExistingEditor = do_GetWeakReference(editor);
htmlEditor = new HTMLEditor();
mExistingEditor =
do_GetWeakReference(static_cast<nsIEditor*>(htmlEditor.get()));
}
// set the editor on the docShell. The docShell now owns it.
rv = docShell->SetEditor(editor);
rv = docShell->SetHTMLEditor(htmlEditor);
NS_ENSURE_SUCCESS(rv, rv);
// setup the HTML editor command controller
if (needHTMLController) {
// The third controller takes an nsIEditor as the context
rv = SetupEditorCommandController("@mozilla.org/editor/htmleditorcontroller;1",
aWindow, editor,
aWindow,
static_cast<nsIEditor*>(htmlEditor),
&mHTMLCommandControllerId);
NS_ENSURE_SUCCESS(rv, rv);
}
// Set mimetype on editor
rv = editor->SetContentsMIMEType(mimeCType.get());
rv = htmlEditor->SetContentsMIMEType(mimeCType.get());
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIContentViewer> contentViewer;
@ -449,59 +455,58 @@ nsEditingSession::SetupEditorOnWindow(mozIDOMWindowProxy* aWindow)
// Set up as a doc state listener
// Important! We must have this to broadcast the "obs_documentCreated" message
rv = editor->AddDocumentStateListener(mStateMaintainer);
rv = htmlEditor->AddDocumentStateListener(mStateMaintainer);
NS_ENSURE_SUCCESS(rv, rv);
rv = editor->Init(domDoc, nullptr /* root content */,
nullptr, mEditorFlags, EmptyString());
rv = htmlEditor->Init(domDoc, nullptr /* root content */,
nullptr, mEditorFlags, EmptyString());
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsISelection> selection;
editor->GetSelection(getter_AddRefs(selection));
nsCOMPtr<nsISelectionPrivate> selPriv = do_QueryInterface(selection);
NS_ENSURE_TRUE(selPriv, NS_ERROR_FAILURE);
RefPtr<Selection> selection = htmlEditor->GetSelection();
if (NS_WARN_IF(!selection)) {
return NS_ERROR_FAILURE;
}
rv = selPriv->AddSelectionListener(mStateMaintainer);
rv = selection->AddSelectionListener(mStateMaintainer);
NS_ENSURE_SUCCESS(rv, rv);
// and as a transaction listener
nsCOMPtr<nsITransactionManager> txnMgr;
editor->GetTransactionManager(getter_AddRefs(txnMgr));
htmlEditor->GetTransactionManager(getter_AddRefs(txnMgr));
if (txnMgr) {
txnMgr->AddListener(mStateMaintainer);
}
// Set context on all controllers to be the editor
rv = SetEditorOnControllers(aWindow, editor);
rv = SetEditorOnControllers(aWindow, htmlEditor);
NS_ENSURE_SUCCESS(rv, rv);
// Everything went fine!
mEditorStatus = eEditorOK;
// This will trigger documentCreation notification
return editor->PostCreate();
return htmlEditor->PostCreate();
}
// Removes all listeners and controllers from aWindow and aEditor.
void
nsEditingSession::RemoveListenersAndControllers(nsPIDOMWindowOuter* aWindow,
nsIEditor *aEditor)
HTMLEditor* aHTMLEditor)
{
if (!mStateMaintainer || !aEditor) {
if (!mStateMaintainer || !aHTMLEditor) {
return;
}
// Remove all the listeners
nsCOMPtr<nsISelection> selection;
aEditor->GetSelection(getter_AddRefs(selection));
nsCOMPtr<nsISelectionPrivate> selPriv = do_QueryInterface(selection);
if (selPriv)
selPriv->RemoveSelectionListener(mStateMaintainer);
RefPtr<Selection> selection = aHTMLEditor->GetSelection();
if (selection) {
selection->RemoveSelectionListener(mStateMaintainer);
}
aEditor->RemoveDocumentStateListener(mStateMaintainer);
aHTMLEditor->RemoveDocumentStateListener(mStateMaintainer);
nsCOMPtr<nsITransactionManager> txnMgr;
aEditor->GetTransactionManager(getter_AddRefs(txnMgr));
aHTMLEditor->GetTransactionManager(getter_AddRefs(txnMgr));
if (txnMgr) {
txnMgr->RemoveListener(mStateMaintainer);
}
@ -526,8 +531,6 @@ nsEditingSession::TearDownEditorOnWindow(mozIDOMWindowProxy *aWindow)
NS_ENSURE_TRUE(aWindow, NS_ERROR_NULL_POINTER);
nsresult rv;
// Kill any existing reload timer
if (mLoadBlankDocTimer) {
mLoadBlankDocTimer->Cancel();
@ -549,15 +552,12 @@ nsEditingSession::TearDownEditorOnWindow(mozIDOMWindowProxy *aWindow)
nsCOMPtr<nsIDocShell> docShell = window->GetDocShell();
NS_ENSURE_STATE(docShell);
nsCOMPtr<nsIEditor> editor;
rv = docShell->GetEditor(getter_AddRefs(editor));
NS_ENSURE_SUCCESS(rv, rv);
RefPtr<HTMLEditor> htmlEditor = docShell->GetHTMLEditor();
if (stopEditing) {
htmlDoc->TearingDownEditor(editor);
htmlDoc->TearingDownEditor();
}
if (mStateMaintainer && editor) {
if (mStateMaintainer && htmlEditor) {
// Null out the editor on the controllers first to prevent their weak
// references from pointing to a destroyed editor.
SetEditorOnControllers(aWindow, nullptr);
@ -567,7 +567,7 @@ nsEditingSession::TearDownEditorOnWindow(mozIDOMWindowProxy *aWindow)
// needs to happen before document state listeners are removed below.
docShell->SetEditor(nullptr);
RemoveListenersAndControllers(window, editor);
RemoveListenersAndControllers(window, htmlEditor);
if (stopEditing) {
// Make things the way they were before we started editing.
@ -583,7 +583,7 @@ nsEditingSession::TearDownEditorOnWindow(mozIDOMWindowProxy *aWindow)
}
}
return rv;
return NS_OK;
}
/*---------------------------------------------------------------------------
@ -596,11 +596,12 @@ NS_IMETHODIMP
nsEditingSession::GetEditorForWindow(mozIDOMWindowProxy* aWindow,
nsIEditor **outEditor)
{
NS_ENSURE_STATE(aWindow);
nsCOMPtr<nsIDocShell> docShell = nsPIDOMWindowOuter::From(aWindow)->GetDocShell();
NS_ENSURE_STATE(docShell);
return docShell->GetEditor(outEditor);
if (NS_WARN_IF(!aWindow)) {
return NS_ERROR_INVALID_ARG;
}
nsCOMPtr<nsIEditor> editor = GetHTMLEditorForWindow(aWindow);
editor.forget(outEditor);
return NS_OK;
}
/*---------------------------------------------------------------------------
@ -952,11 +953,7 @@ nsEditingSession::EndDocumentLoad(nsIWebProgress *aWebProgress,
needsSetup = true;
} else {
// do we already have an editor here?
nsCOMPtr<nsIEditor> editor;
rv = docShell->GetEditor(getter_AddRefs(editor));
NS_ENSURE_SUCCESS(rv, rv);
needsSetup = !editor;
needsSetup = !docShell->GetHTMLEditor();
}
if (needsSetup) {
@ -1169,7 +1166,7 @@ nsEditingSession::SetEditorOnControllers(mozIDOMWindowProxy* aWindow,
nsresult rv = piWindow->GetControllers(getter_AddRefs(controllers));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsISupports> editorAsISupports = do_QueryInterface(aEditor);
nsCOMPtr<nsISupports> editorAsISupports = static_cast<nsISupports*>(aEditor);
if (mBaseCommandControllerId) {
rv = SetContextOnControllerById(controllers, editorAsISupports,
mBaseCommandControllerId);
@ -1358,9 +1355,10 @@ nsEditingSession::ReattachToWindow(mozIDOMWindowProxy* aWindow)
}
// Get editor
nsCOMPtr<nsIEditor> editor;
rv = GetEditorForWindow(aWindow, getter_AddRefs(editor));
NS_ENSURE_TRUE(editor, NS_ERROR_FAILURE);
RefPtr<HTMLEditor> htmlEditor = GetHTMLEditorForWindow(aWindow);
if (NS_WARN_IF(!htmlEditor)) {
return NS_ERROR_FAILURE;
}
if (!mInteractive) {
// Disable animation of images in this document:
@ -1375,12 +1373,13 @@ nsEditingSession::ReattachToWindow(mozIDOMWindowProxy* aWindow)
// The third controller takes an nsIEditor as the context
rv = SetupEditorCommandController("@mozilla.org/editor/htmleditorcontroller;1",
aWindow, editor,
aWindow,
static_cast<nsIEditor*>(htmlEditor.get()),
&mHTMLCommandControllerId);
NS_ENSURE_SUCCESS(rv, rv);
// Set context on all controllers to be the editor
rv = SetEditorOnControllers(aWindow, editor);
rv = SetEditorOnControllers(aWindow, htmlEditor);
NS_ENSURE_SUCCESS(rv, rv);
#ifdef DEBUG
@ -1394,3 +1393,19 @@ nsEditingSession::ReattachToWindow(mozIDOMWindowProxy* aWindow)
return NS_OK;
}
HTMLEditor*
nsIEditingSession::GetHTMLEditorForWindow(mozIDOMWindowProxy* aWindow)
{
if (NS_WARN_IF(!aWindow)) {
return nullptr;
}
nsCOMPtr<nsIDocShell> docShell =
nsPIDOMWindowOuter::From(aWindow)->GetDocShell();
if (NS_WARN_IF(!docShell)) {
return nullptr;
}
return docShell->GetHTMLEditor();
}

Просмотреть файл

@ -43,6 +43,10 @@ class nsIDocShell;
class nsIEditor;
class nsIWebProgress;
namespace mozilla {
class HTMLEditor;
} // namespace mozilla
class nsEditingSession final : public nsIEditingSession,
public nsIWebProgressListener,
public nsSupportsWeakReference
@ -92,8 +96,9 @@ protected:
void RemoveEditorControllers(nsPIDOMWindowOuter* aWindow);
void RemoveWebProgressListener(nsPIDOMWindowOuter* aWindow);
void RestoreAnimationMode(nsPIDOMWindowOuter* aWindow);
void RemoveListenersAndControllers(nsPIDOMWindowOuter* aWindow,
nsIEditor *aEditor);
void RemoveListenersAndControllers(
nsPIDOMWindowOuter* aWindow,
mozilla::HTMLEditor* aHTMLEditor);
protected:

Просмотреть файл

@ -9,6 +9,13 @@
interface mozIDOMWindowProxy;
interface nsIEditor;
%{ C++
class mozIDOMWindowProxy;
namespace mozilla {
class HTMLEditor;
} // namespace mozilla
%}
[scriptable, builtinclass, uuid(24f963d1-e6fc-43ea-a206-99ac5fcc5265)]
interface nsIEditingSession : nsISupports
@ -100,5 +107,15 @@ interface nsIEditingSession : nsISupports
* Whether this session has disabled JS and plugins.
*/
readonly attribute boolean jsAndPluginsDisabled;
%{C++
/**
* This method is implemented with nsIDocShell::GetHTMLEditor(). I.e.,
* This method doesn't depend on nsEditingSession. Therefore, even if
* there were some implementation of nsIEditingSession interface, this
* would be safe to use.
*/
mozilla::HTMLEditor* GetHTMLEditorForWindow(mozIDOMWindowProxy* aWindow);
%}
};

Просмотреть файл

@ -502,13 +502,13 @@ AlphaBoxBlur::Init(const Rect& aRect,
mSkipRect = IntRect(0, 0, 0, 0);
}
CheckedInt<int32_t> stride = RoundUpToMultipleOf4(mRect.width);
CheckedInt<int32_t> stride = RoundUpToMultipleOf4(mRect.Width());
if (stride.isValid()) {
mStride = stride.value();
// We need to leave room for an additional 3 bytes for a potential overrun
// in our blurring code.
size_t size = BufferSizeFromStrideAndHeight(mStride, mRect.height, 3);
size_t size = BufferSizeFromStrideAndHeight(mStride, mRect.Height(), 3);
if (size != 0) {
mSurfaceAllocationSize = size;
}
@ -527,7 +527,7 @@ AlphaBoxBlur::AlphaBoxBlur(const Rect& aRect,
{
IntRect intRect;
if (aRect.ToIntRect(&intRect)) {
size_t minDataSize = BufferSizeFromStrideAndHeight(intRect.width, intRect.height);
size_t minDataSize = BufferSizeFromStrideAndHeight(intRect.Width(), intRect.Height());
if (minDataSize != 0) {
mSurfaceAllocationSize = minDataSize;
}
@ -542,7 +542,7 @@ AlphaBoxBlur::~AlphaBoxBlur()
IntSize
AlphaBoxBlur::GetSize()
{
IntSize size(mRect.width, mRect.height);
IntSize size(mRect.Width(), mRect.Height());
return size;
}

Просмотреть файл

@ -192,8 +192,8 @@ DrawTargetD2D1::DrawSurface(SourceSurface *aSurface,
samplingBounds = D2D1::RectF(0, 0, Float(aSurface->GetSize().width), Float(aSurface->GetSize().height));
}
Float xScale = aDest.width / aSource.width;
Float yScale = aDest.height / aSource.height;
Float xScale = aDest.Width() / aSource.Width();
Float yScale = aDest.Height() / aSource.Height();
RefPtr<ID2D1ImageBrush> brush;
@ -425,8 +425,8 @@ DrawTargetD2D1::MaskSurface(const Pattern &aSource,
// we have to fixup our sizes here.
size.width = bitmap->GetSize().width;
size.height = bitmap->GetSize().height;
dest.width = size.width;
dest.height = size.height;
dest.SetWidth(size.width);
dest.SetHeight(size.height);
}
// FillOpacityMask only works if the antialias mode is MODE_ALIASED
@ -488,10 +488,10 @@ DrawTargetD2D1::CopySurface(SourceSurface *aSurface,
}
Rect srcRect(Float(sourceRect.x), Float(sourceRect.y),
Float(aSourceRect.width), Float(aSourceRect.height));
Float(aSourceRect.Width()), Float(aSourceRect.Height()));
Rect dstRect(Float(aDestination.x), Float(aDestination.y),
Float(aSourceRect.width), Float(aSourceRect.height));
Float(aSourceRect.Width()), Float(aSourceRect.Height()));
if (SUCCEEDED(hr) && bitmap) {
mDC->SetPrimitiveBlend(D2D1_PRIMITIVE_BLEND_COPY);
@ -1881,7 +1881,7 @@ DrawTargetD2D1::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha)
mat.PreTranslate(pat->mSamplingRect.x, pat->mSamplingRect.y);
} else {
// We will do a partial upload of the sampling restricted area from GetImageForSurface.
samplingBounds = D2D1::RectF(0, 0, pat->mSamplingRect.width, pat->mSamplingRect.height);
samplingBounds = D2D1::RectF(0, 0, pat->mSamplingRect.Width(), pat->mSamplingRect.Height());
}
D2D1_EXTEND_MODE xRepeat = D2DExtend(pat->mExtendMode, Axis::X_AXIS);

Просмотреть файл

@ -193,8 +193,8 @@ VerifyRGBXCorners(uint8_t* aData, const IntSize &aSize, const int32_t aStride, S
return true;
}
const int height = bounds.height;
const int width = bounds.width;
const int height = bounds.Height();
const int width = bounds.Width();
const int pixelSize = 4;
MOZ_ASSERT(aSize.width * pixelSize <= aStride);
@ -848,16 +848,16 @@ ShrinkClippedStrokedRect(const Rect &aStrokedRect, const IntRect &aDeviceClip,
Rect userSpaceStrokeClip =
UserSpaceStrokeClip(aDeviceClip, aTransform, aStrokeOptions);
RectDouble strokedRectDouble(
aStrokedRect.x, aStrokedRect.y, aStrokedRect.width, aStrokedRect.height);
aStrokedRect.x, aStrokedRect.y, aStrokedRect.Width(), aStrokedRect.Height());
RectDouble intersection =
strokedRectDouble.Intersect(RectDouble(userSpaceStrokeClip.x,
userSpaceStrokeClip.y,
userSpaceStrokeClip.width,
userSpaceStrokeClip.height));
userSpaceStrokeClip.Width(),
userSpaceStrokeClip.Height()));
Double dashPeriodLength = DashPeriodLength(aStrokeOptions);
if (intersection.IsEmpty() || dashPeriodLength == 0.0f) {
return Rect(
intersection.x, intersection.y, intersection.width, intersection.height);
intersection.x, intersection.y, intersection.Width(), intersection.Height());
}
// Reduce the rectangle side lengths in multiples of the dash period length
@ -871,8 +871,8 @@ ShrinkClippedStrokedRect(const Rect &aStrokedRect, const IntRect &aDeviceClip,
strokedRectDouble.Deflate(insetBy);
return Rect(strokedRectDouble.x,
strokedRectDouble.y,
strokedRectDouble.width,
strokedRectDouble.height);
strokedRectDouble.Width(),
strokedRectDouble.Height());
}
void
@ -1569,7 +1569,7 @@ DrawTarget::Draw3DTransformedSurface(SourceSurface* aSurface, const Matrix4x4& a
}
std::unique_ptr<SkCanvas> dstCanvas(
SkCanvas::MakeRasterDirect(
SkImageInfo::Make(xformBounds.width, xformBounds.height,
SkImageInfo::Make(xformBounds.Width(), xformBounds.Height(),
GfxFormatToSkiaColorType(dstSurf->GetFormat()),
kPremul_SkAlphaType),
dstSurf->GetData(), dstSurf->Stride()));
@ -1819,7 +1819,7 @@ DrawTargetSkia::CopySurface(SourceSurface *aSurface,
mCanvas->save();
mCanvas->setMatrix(SkMatrix::MakeTrans(SkIntToScalar(aDestination.x), SkIntToScalar(aDestination.y)));
mCanvas->clipRect(SkRect::MakeIWH(aSourceRect.width, aSourceRect.height), SkClipOp::kReplace_deprecated);
mCanvas->clipRect(SkRect::MakeIWH(aSourceRect.Width(), aSourceRect.Height()), SkClipOp::kReplace_deprecated);
SkPaint paint;
if (!image->isOpaque()) {

Просмотреть файл

@ -43,7 +43,7 @@ public:
virtual already_AddRefed<SourceSurface> Snapshot() override;
virtual void DetachAllSnapshots() override;
virtual IntSize GetSize() override {
MOZ_ASSERT(mRect.width > 0 && mRect.height > 0);
MOZ_ASSERT(mRect.Width() > 0 && mRect.Height() > 0);
return IntSize(mRect.XMost(), mRect.YMost());
}
@ -186,7 +186,7 @@ public:
virtual SurfaceType GetType() const { return SurfaceType::TILED; }
virtual IntSize GetSize() const {
MOZ_ASSERT(mRect.width > 0 && mRect.height > 0);
MOZ_ASSERT(mRect.Width() > 0 && mRect.Height() > 0);
return IntSize(mRect.XMost(), mRect.YMost());
}
virtual SurfaceFormat GetFormat() const { return mSnapshots[0]->GetFormat(); }

Просмотреть файл

@ -812,7 +812,7 @@ FilterNodeD2D1::SetAttribute(uint32_t aIndex, const IntRect &aValue)
MOZ_ASSERT(aIndex == ATT_TURBULENCE_RECT);
mEffect->SetValue(D2D1_TURBULENCE_PROP_OFFSET, D2D1::Vector2F(Float(aValue.x), Float(aValue.y)));
mEffect->SetValue(D2D1_TURBULENCE_PROP_SIZE, D2D1::Vector2F(Float(aValue.width), Float(aValue.height)));
mEffect->SetValue(D2D1_TURBULENCE_PROP_SIZE, D2D1::Vector2F(Float(aValue.Width()), Float(aValue.Height())));
return;
}

Просмотреть файл

@ -218,17 +218,17 @@ FillRectWithPixel(DataSourceSurface *aSurface, const IntRect &aFillRect, IntPoin
// Fill the first row by hand.
if (bpp == 4) {
uint32_t sourcePixel = *(uint32_t*)sourcePixelData;
for (int32_t x = 0; x < aFillRect.width; x++) {
for (int32_t x = 0; x < aFillRect.Width(); x++) {
*((uint32_t*)data + x) = sourcePixel;
}
} else if (BytesPerPixel(aSurface->GetFormat()) == 1) {
uint8_t sourcePixel = *sourcePixelData;
memset(data, sourcePixel, aFillRect.width);
memset(data, sourcePixel, aFillRect.Width());
}
// Copy the first row into the other rows.
for (int32_t y = 1; y < aFillRect.height; y++) {
PodCopy(data + y * surfMap.GetStride(), data, aFillRect.width * bpp);
for (int32_t y = 1; y < aFillRect.Height(); y++) {
PodCopy(data + y * surfMap.GetStride(), data, aFillRect.Width() * bpp);
}
}
@ -252,13 +252,13 @@ FillRectWithVerticallyRepeatingHorizontalStrip(DataSourceSurface *aSurface,
uint8_t* sampleData = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aSampleRect.TopLeft());
uint8_t* data = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aFillRect.TopLeft());
if (BytesPerPixel(aSurface->GetFormat()) == 4) {
for (int32_t y = 0; y < aFillRect.height; y++) {
PodCopy((uint32_t*)data, (uint32_t*)sampleData, aFillRect.width);
for (int32_t y = 0; y < aFillRect.Height(); y++) {
PodCopy((uint32_t*)data, (uint32_t*)sampleData, aFillRect.Width());
data += surfMap.GetStride();
}
} else if (BytesPerPixel(aSurface->GetFormat()) == 1) {
for (int32_t y = 0; y < aFillRect.height; y++) {
PodCopy(data, sampleData, aFillRect.width);
for (int32_t y = 0; y < aFillRect.Height(); y++) {
PodCopy(data, sampleData, aFillRect.Width());
data += surfMap.GetStride();
}
}
@ -284,18 +284,18 @@ FillRectWithHorizontallyRepeatingVerticalStrip(DataSourceSurface *aSurface,
uint8_t* sampleData = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aSampleRect.TopLeft());
uint8_t* data = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aFillRect.TopLeft());
if (BytesPerPixel(aSurface->GetFormat()) == 4) {
for (int32_t y = 0; y < aFillRect.height; y++) {
for (int32_t y = 0; y < aFillRect.Height(); y++) {
int32_t sampleColor = *((uint32_t*)sampleData);
for (int32_t x = 0; x < aFillRect.width; x++) {
for (int32_t x = 0; x < aFillRect.Width(); x++) {
*((uint32_t*)data + x) = sampleColor;
}
data += surfMap.GetStride();
sampleData += surfMap.GetStride();
}
} else if (BytesPerPixel(aSurface->GetFormat()) == 1) {
for (int32_t y = 0; y < aFillRect.height; y++) {
for (int32_t y = 0; y < aFillRect.Height(); y++) {
uint8_t sampleColor = *sampleData;
memset(data, sampleColor, aFillRect.width);
memset(data, sampleColor, aFillRect.Width());
data += surfMap.GetStride();
sampleData += surfMap.GetStride();
}
@ -316,24 +316,24 @@ DuplicateEdges(DataSourceSurface* aSurface, const IntRect &aFromRect)
switch (ix) {
case 0:
fill.x = 0;
fill.width = aFromRect.x;
fill.SetWidth(aFromRect.x);
sampleRect.x = fill.XMost();
sampleRect.width = 1;
sampleRect.SetWidth(1);
break;
case 1:
fill.x = aFromRect.x;
fill.width = aFromRect.width;
fill.SetWidth(aFromRect.Width());
sampleRect.x = fill.x;
sampleRect.width = fill.width;
sampleRect.SetWidth(fill.Width());
break;
case 2:
fill.x = aFromRect.XMost();
fill.width = size.width - fill.x;
fill.SetWidth(size.width - fill.x);
sampleRect.x = fill.x - 1;
sampleRect.width = 1;
sampleRect.SetWidth(1);
break;
}
if (fill.width <= 0) {
if (fill.Width() <= 0) {
continue;
}
bool xIsMiddle = (ix == 1);
@ -341,24 +341,24 @@ DuplicateEdges(DataSourceSurface* aSurface, const IntRect &aFromRect)
switch (iy) {
case 0:
fill.y = 0;
fill.height = aFromRect.y;
fill.SetHeight(aFromRect.y);
sampleRect.y = fill.YMost();
sampleRect.height = 1;
sampleRect.SetHeight(1);
break;
case 1:
fill.y = aFromRect.y;
fill.height = aFromRect.height;
fill.SetHeight(aFromRect.Height());
sampleRect.y = fill.y;
sampleRect.height = fill.height;
sampleRect.SetHeight(fill.Height());
break;
case 2:
fill.y = aFromRect.YMost();
fill.height = size.height - fill.y;
fill.SetHeight(size.height - fill.y);
sampleRect.y = fill.y - 1;
sampleRect.height = 1;
sampleRect.SetHeight(1);
break;
}
if (fill.height <= 0) {
if (fill.Height() <= 0) {
continue;
}
bool yIsMiddle = (iy == 1);
@ -381,8 +381,8 @@ DuplicateEdges(DataSourceSurface* aSurface, const IntRect &aFromRect)
static IntPoint
TileIndex(const IntRect &aFirstTileRect, const IntPoint &aPoint)
{
return IntPoint(int32_t(floor(double(aPoint.x - aFirstTileRect.x) / aFirstTileRect.width)),
int32_t(floor(double(aPoint.y - aFirstTileRect.y) / aFirstTileRect.height)));
return IntPoint(int32_t(floor(double(aPoint.x - aFirstTileRect.x) / aFirstTileRect.Width())),
int32_t(floor(double(aPoint.y - aFirstTileRect.y) / aFirstTileRect.Height())));
}
static void
@ -395,8 +395,8 @@ TileSurface(DataSourceSurface* aSource, DataSourceSurface* aTarget, const IntPoi
for (int32_t ix = startIndex.x; ix <= endIndex.x; ix++) {
for (int32_t iy = startIndex.y; iy <= endIndex.y; iy++) {
IntPoint destPoint(sourceRect.x + ix * sourceRect.width,
sourceRect.y + iy * sourceRect.height);
IntPoint destPoint(sourceRect.x + ix * sourceRect.Width(),
sourceRect.y + iy * sourceRect.Height());
IntRect destRect(destPoint, sourceRect.Size());
destRect = destRect.Intersect(targetRect);
IntRect srcRect = destRect - destPoint;
@ -694,7 +694,7 @@ FilterNodeSoftware::GetInputDataSourceSurface(uint32_t aInputEnumIndex,
#ifdef DEBUG_DUMP_SURFACES
printf("<section><h1>GetInputDataSourceSurface with aRect: %d, %d, %d, %d</h1>\n",
aRect.x, aRect.y, aRect.width, aRect.height);
aRect.x, aRect.y, aRect.Width(), aRect.Height());
#endif
int32_t inputIndex = InputIndex(aInputEnumIndex);
if (inputIndex < 0 || (uint32_t)inputIndex >= NumberOfSetInputs()) {
@ -1147,7 +1147,7 @@ FilterNodeTransformSoftware::Render(const IntRect& aRect)
return nullptr;
}
Rect r(0, 0, srcRect.width, srcRect.height);
Rect r(0, 0, srcRect.Width(), srcRect.Height());
dt->SetTransform(transform);
dt->DrawSurface(input, r, r, DrawSurfaceOptions(mSamplingFilter));
@ -1218,7 +1218,7 @@ ApplyMorphology(const IntRect& aSourceRect, DataSourceSurface* aInput,
{
IntRect srcRect = aSourceRect - aDestRect.TopLeft();
IntRect destRect = aDestRect - aDestRect.TopLeft();
IntRect tmpRect(destRect.x, srcRect.y, destRect.width, srcRect.height);
IntRect tmpRect(destRect.x, srcRect.y, destRect.Width(), srcRect.Height());
#ifdef DEBUG
IntMargin margin = srcRect - destRect;
MOZ_ASSERT(margin.top >= ry && margin.right >= rx &&
@ -1499,20 +1499,20 @@ FilterNodeFloodSoftware::Render(const IntRect& aRect)
if (format == SurfaceFormat::B8G8R8A8) {
uint32_t color = ColorToBGRA(mColor);
for (int32_t y = 0; y < aRect.height; y++) {
for (int32_t x = 0; x < aRect.width; x++) {
for (int32_t y = 0; y < aRect.Height(); y++) {
for (int32_t x = 0; x < aRect.Width(); x++) {
*((uint32_t*)targetData + x) = color;
}
PodZero(&targetData[aRect.width * 4], stride - aRect.width * 4);
PodZero(&targetData[aRect.Width() * 4], stride - aRect.Width() * 4);
targetData += stride;
}
} else if (format == SurfaceFormat::A8) {
uint8_t alpha = NS_lround(mColor.a * 255.0f);
for (int32_t y = 0; y < aRect.height; y++) {
for (int32_t x = 0; x < aRect.width; x++) {
for (int32_t y = 0; y < aRect.Height(); y++) {
for (int32_t x = 0; x < aRect.Width(); x++) {
targetData[x] = alpha;
}
PodZero(&targetData[aRect.width], stride - aRect.width);
PodZero(&targetData[aRect.Width()], stride - aRect.Width());
targetData += stride;
}
} else {
@ -1555,7 +1555,7 @@ FilterNodeTileSoftware::SetAttribute(uint32_t aIndex,
{
MOZ_ASSERT(aIndex == ATT_TILE_SOURCE_RECT);
mSourceRect = IntRect(int32_t(aSourceRect.x), int32_t(aSourceRect.y),
int32_t(aSourceRect.width), int32_t(aSourceRect.height));
int32_t(aSourceRect.Width()), int32_t(aSourceRect.Height()));
Invalidate();
}
@ -1570,10 +1570,10 @@ struct CompareIntRects
if (a.y != b.y) {
return a.y < b.y;
}
if (a.width != b.width) {
return a.width < b.width;
if (a.Width() != b.Width()) {
return a.Width() < b.Width();
}
return a.height < b.height;
return a.Height() < b.Height();
}
};
@ -1599,8 +1599,8 @@ FilterNodeTileSoftware::Render(const IntRect& aRect)
IntPoint endIndex = TileIndex(mSourceRect, aRect.BottomRight());
for (int32_t ix = startIndex.x; ix <= endIndex.x; ix++) {
for (int32_t iy = startIndex.y; iy <= endIndex.y; iy++) {
IntPoint sourceToDestOffset(ix * mSourceRect.width,
iy * mSourceRect.height);
IntPoint sourceToDestOffset(ix * mSourceRect.Width(),
iy * mSourceRect.Height());
IntRect destRect = aRect.Intersect(mSourceRect + sourceToDestOffset);
IntRect srcRect = destRect - sourceToDestOffset;
if (srcRect.IsEmpty()) {
@ -2504,10 +2504,10 @@ FilterNodeConvolveMatrixSoftware::DoRender(const IntRect& aRect,
}
int32_t bias = NS_lround(mBias * 255 * factorFromShifts);
for (int32_t y = 0; y < aRect.height; y++) {
for (int32_t x = 0; x < aRect.width; x++) {
for (int32_t y = 0; y < aRect.Height(); y++) {
for (int32_t x = 0; x < aRect.Width(); x++) {
ConvolvePixel(sourceData, targetData,
aRect.width, aRect.height, sourceStride, targetStride,
aRect.Width(), aRect.Height(), sourceStride, targetStride,
x, y, intKernel, bias, shiftL, shiftR, mPreserveAlpha,
mKernelSize.width, mKernelSize.height, mTarget.x, mTarget.y,
aKernelUnitLengthX, aKernelUnitLengthY);
@ -2650,8 +2650,8 @@ FilterNodeDisplacementMapSoftware::Render(const IntRect& aRect)
float scaleOver255 = mScale / 255.0f;
float scaleAdjustment = -0.5f * mScale;
for (int32_t y = 0; y < aRect.height; y++) {
for (int32_t x = 0; x < aRect.width; x++) {
for (int32_t y = 0; y < aRect.Height(); y++) {
for (int32_t x = 0; x < aRect.Width(); x++) {
uint32_t mapIndex = y * mapStride + 4 * x;
uint32_t targIndex = y * targetStride + 4 * x;
int32_t sourceX = x +
@ -2663,7 +2663,7 @@ FilterNodeDisplacementMapSoftware::Render(const IntRect& aRect)
}
// Keep valgrind happy.
PodZero(&targetData[y * targetStride + 4 * aRect.width], targetStride - 4 * aRect.width);
PodZero(&targetData[y * targetStride + 4 * aRect.Width()], targetStride - 4 * aRect.Width());
}
return target.forget();
@ -2974,7 +2974,7 @@ FilterNodeBlurXYSoftware::Render(const IntRect& aRect)
}
RefPtr<DataSourceSurface> target;
Rect r(0, 0, srcRect.width, srcRect.height);
Rect r(0, 0, srcRect.Width(), srcRect.Height());
if (input->GetFormat() == SurfaceFormat::A8) {
target = Factory::CreateDataSourceSurface(srcRect.Size(), SurfaceFormat::A8);

Просмотреть файл

@ -578,7 +578,7 @@ CreatePartialBitmapForSurface(DataSourceSurface *aSurface, const Matrix &aDestin
Rect uploadRect(0, 0, Float(size.width), Float(size.height));
if (aSourceRect) {
uploadRect = Rect(aSourceRect->x, aSourceRect->y, aSourceRect->width, aSourceRect->height);
uploadRect = Rect(aSourceRect->x, aSourceRect->y, aSourceRect->Width(), aSourceRect->Height());
}
// Limit the uploadRect as much as possible without supporting discontiguous uploads
@ -610,10 +610,10 @@ CreatePartialBitmapForSurface(DataSourceSurface *aSurface, const Matrix &aDestin
// upload rect safely without looking at extend mode.
} else if (rect.x >= 0 && rect.XMost() < size.width) {
uploadRect.x = rect.x;
uploadRect.width = rect.width;
uploadRect.SetWidth(rect.Width());
} else if (rect.y >= 0 && rect.YMost() < size.height) {
uploadRect.y = rect.y;
uploadRect.height = rect.height;
uploadRect.SetHeight(rect.Height());
}
if (uploadRect.IsEmpty()) {
@ -621,8 +621,8 @@ CreatePartialBitmapForSurface(DataSourceSurface *aSurface, const Matrix &aDestin
return nullptr;
}
if (uploadRect.width <= aRT->GetMaximumBitmapSize() &&
uploadRect.height <= aRT->GetMaximumBitmapSize()) {
if (uploadRect.Width() <= aRT->GetMaximumBitmapSize() &&
uploadRect.Height() <= aRT->GetMaximumBitmapSize()) {
{
// Scope to auto-Unmap() |mapping|.
DataSourceSurface::ScopedMap mapping(aSurface, DataSourceSurface::READ);
@ -631,7 +631,7 @@ CreatePartialBitmapForSurface(DataSourceSurface *aSurface, const Matrix &aDestin
}
// A partial upload will suffice.
aRT->CreateBitmap(D2D1::SizeU(uint32_t(uploadRect.width), uint32_t(uploadRect.height)),
aRT->CreateBitmap(D2D1::SizeU(uint32_t(uploadRect.Width()), uint32_t(uploadRect.Height())),
mapping.GetData() + int(uploadRect.x) * Bpp + int(uploadRect.y) * mapping.GetStride(),
mapping.GetStride(),
D2D1::BitmapProperties(D2DPixelFormat(aSurface->GetFormat())),

Просмотреть файл

@ -274,27 +274,27 @@ static inline SkRect
RectToSkRect(const Rect& aRect)
{
return SkRect::MakeXYWH(SkFloatToScalar(aRect.x), SkFloatToScalar(aRect.y),
SkFloatToScalar(aRect.width), SkFloatToScalar(aRect.height));
SkFloatToScalar(aRect.Width()), SkFloatToScalar(aRect.Height()));
}
static inline SkRect
IntRectToSkRect(const IntRect& aRect)
{
return SkRect::MakeXYWH(SkIntToScalar(aRect.x), SkIntToScalar(aRect.y),
SkIntToScalar(aRect.width), SkIntToScalar(aRect.height));
SkIntToScalar(aRect.Width()), SkIntToScalar(aRect.Height()));
}
static inline SkIRect
RectToSkIRect(const Rect& aRect)
{
return SkIRect::MakeXYWH(int32_t(aRect.x), int32_t(aRect.y),
int32_t(aRect.width), int32_t(aRect.height));
int32_t(aRect.Width()), int32_t(aRect.Height()));
}
static inline SkIRect
IntRectToSkIRect(const IntRect& aRect)
{
return SkIRect::MakeXYWH(aRect.x, aRect.y, aRect.width, aRect.height);
return SkIRect::MakeXYWH(aRect.x, aRect.y, aRect.Width(), aRect.Height());
}
static inline IntRect

Просмотреть файл

@ -1682,7 +1682,7 @@ RecordedFillRect::RecordedFillRect(S &aStream)
inline void
RecordedFillRect::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] FillRect (" << mRect.x << ", " << mRect.y << " - " << mRect.width << " x " << mRect.height << ") ";
aStringStream << "[" << mDT << "] FillRect (" << mRect.x << ", " << mRect.y << " - " << mRect.Width() << " x " << mRect.Height() << ") ";
OutputSimplePatternInfo(mPattern, aStringStream);
}
@ -1717,7 +1717,7 @@ RecordedStrokeRect::RecordedStrokeRect(S &aStream)
inline void
RecordedStrokeRect::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] StrokeRect (" << mRect.x << ", " << mRect.y << " - " << mRect.width << " x " << mRect.height
aStringStream << "[" << mDT << "] StrokeRect (" << mRect.x << ", " << mRect.y << " - " << mRect.Width() << " x " << mRect.Height()
<< ") LineWidth: " << mStrokeOptions.mLineWidth << "px ";
OutputSimplePatternInfo(mPattern, aStringStream);
}
@ -1935,7 +1935,7 @@ RecordedClearRect::RecordedClearRect(S &aStream)
inline void
RecordedClearRect::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT<< "] ClearRect (" << mRect.x << ", " << mRect.y << " - " << mRect.width << " x " << mRect.height << ") ";
aStringStream << "[" << mDT<< "] ClearRect (" << mRect.x << ", " << mRect.y << " - " << mRect.Width() << " x " << mRect.Height() << ") ";
}
inline bool
@ -2024,7 +2024,7 @@ RecordedPushClipRect::RecordedPushClipRect(S &aStream)
inline void
RecordedPushClipRect::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] PushClipRect (" << mRect.x << ", " << mRect.y << " - " << mRect.width << " x " << mRect.height << ") ";
aStringStream << "[" << mDT << "] PushClipRect (" << mRect.x << ", " << mRect.y << " - " << mRect.Width() << " x " << mRect.Height() << ") ";
}
inline bool

Просмотреть файл

@ -118,25 +118,25 @@ struct IntRectTyped :
auto tmp(aRect);
tmp.RoundIn();
return IntRectTyped(int32_t(tmp.x), int32_t(tmp.y),
int32_t(tmp.width), int32_t(tmp.height));
int32_t(tmp.Width()), int32_t(tmp.Height()));
}
static IntRectTyped<units> RoundOut(const RectTyped<units, float>& aRect) {
auto tmp(aRect);
tmp.RoundOut();
return IntRectTyped(int32_t(tmp.x), int32_t(tmp.y),
int32_t(tmp.width), int32_t(tmp.height));
int32_t(tmp.Width()), int32_t(tmp.Height()));
}
static IntRectTyped<units> Round(const RectTyped<units, float>& aRect) {
auto tmp(aRect);
tmp.Round();
return IntRectTyped(int32_t(tmp.x), int32_t(tmp.y),
int32_t(tmp.width), int32_t(tmp.height));
int32_t(tmp.Width()), int32_t(tmp.Height()));
}
static IntRectTyped<units> Truncate(const RectTyped<units, float>& aRect) {
return IntRectTyped::Truncate(aRect.x, aRect.y, aRect.width, aRect.height);
return IntRectTyped::Truncate(aRect.x, aRect.y, aRect.Width(), aRect.Height());
}
// Rounding isn't meaningful on an integer rectangle.
@ -148,18 +148,18 @@ struct IntRectTyped :
// to and from unknown types should be removed.
static IntRectTyped<units> FromUnknownRect(const IntRectTyped<UnknownUnits>& rect) {
return IntRectTyped<units>(rect.x, rect.y, rect.width, rect.height);
return IntRectTyped<units>(rect.x, rect.y, rect.Width(), rect.Height());
}
IntRectTyped<UnknownUnits> ToUnknownRect() const {
return IntRectTyped<UnknownUnits>(this->x, this->y, this->width, this->height);
return IntRectTyped<UnknownUnits>(this->x, this->y, this->Width(), this->Height());
}
bool Overflows() const {
CheckedInt<int32_t> xMost = this->x;
xMost += this->width;
xMost += this->Width();
CheckedInt<int32_t> yMost = this->y;
yMost += this->height;
yMost += this->Height();
return !xMost.isValid() || !yMost.isValid();
}
@ -218,8 +218,8 @@ struct IntRectTyped :
xMost = mozilla::RoundUpToMultiple(xMost, aTileSize.width);
yMost = mozilla::RoundUpToMultiple(yMost, aTileSize.height);
this->width = xMost - this->x;
this->height = yMost - this->y;
this->SetWidth(xMost - this->x);
this->SetHeight(yMost - this->y);
}
};
@ -241,7 +241,7 @@ struct RectTyped :
Super(_x, _y, _width, _height) {}
explicit RectTyped(const IntRectTyped<units>& rect) :
Super(F(rect.x), F(rect.y),
F(rect.width), F(rect.height)) {}
F(rect.Width()), F(rect.Height())) {}
void NudgeToIntegers()
{
@ -256,7 +256,7 @@ struct RectTyped :
*aOut = IntRectTyped<units>(int32_t(this->X()), int32_t(this->Y()),
int32_t(this->Width()), int32_t(this->Height()));
return RectTyped<units, F>(F(aOut->x), F(aOut->y),
F(aOut->width), F(aOut->height))
F(aOut->Width()), F(aOut->Height()))
.IsEqualEdges(*this);
}
@ -264,11 +264,11 @@ struct RectTyped :
// unknown types should be removed.
static RectTyped<units, F> FromUnknownRect(const RectTyped<UnknownUnits, F>& rect) {
return RectTyped<units, F>(rect.x, rect.y, rect.width, rect.height);
return RectTyped<units, F>(rect.x, rect.y, rect.Width(), rect.Height());
}
RectTyped<UnknownUnits, F> ToUnknownRect() const {
return RectTyped<UnknownUnits, F>(this->x, this->y, this->width, this->height);
return RectTyped<UnknownUnits, F>(this->x, this->y, this->Width(), this->Height());
}
// This is here only to keep IPDL-generated code happy. DO NOT USE.
@ -287,8 +287,8 @@ IntRectTyped<units> RoundedToInt(const RectTyped<units>& aRect)
copy.Round();
return IntRectTyped<units>(int32_t(copy.x),
int32_t(copy.y),
int32_t(copy.width),
int32_t(copy.height));
int32_t(copy.Width()),
int32_t(copy.Height()));
}
template<class units>
@ -311,7 +311,7 @@ IntRectTyped<units> TruncatedToInt(const RectTyped<units>& aRect) {
template<class units>
RectTyped<units> IntRectToRect(const IntRectTyped<units>& aRect)
{
return RectTyped<units>(aRect.x, aRect.y, aRect.width, aRect.height);
return RectTyped<units>(aRect.x, aRect.y, aRect.Width(), aRect.Height());
}
// Convenience function for intersecting two rectangles wrapped in Maybes.

Просмотреть файл

@ -175,8 +175,8 @@ template<TurbulenceType Type, bool Stitch, typename f32x4_t, typename i32x4_t, t
void
SVGTurbulenceRenderer<Type,Stitch,f32x4_t,i32x4_t,u8x16_t>::AdjustBaseFrequencyForStitch(const Rect &aTileRect)
{
mBaseFrequency = Size(AdjustForLength(mBaseFrequency.width, aTileRect.width),
AdjustForLength(mBaseFrequency.height, aTileRect.height));
mBaseFrequency = Size(AdjustForLength(mBaseFrequency.width, aTileRect.Width()),
AdjustForLength(mBaseFrequency.height, aTileRect.Height()));
}
template<TurbulenceType Type, bool Stitch, typename f32x4_t, typename i32x4_t, typename u8x16_t>
@ -184,8 +184,8 @@ typename SVGTurbulenceRenderer<Type,Stitch,f32x4_t,i32x4_t,u8x16_t>::StitchInfo
SVGTurbulenceRenderer<Type,Stitch,f32x4_t,i32x4_t,u8x16_t>::CreateStitchInfo(const Rect &aTileRect) const
{
StitchInfo stitch;
stitch.width = int32_t(floorf(aTileRect.width * mBaseFrequency.width + 0.5f));
stitch.height = int32_t(floorf(aTileRect.height * mBaseFrequency.height + 0.5f));
stitch.width = int32_t(floorf(aTileRect.Width() * mBaseFrequency.width + 0.5f));
stitch.height = int32_t(floorf(aTileRect.Height() * mBaseFrequency.height + 0.5f));
stitch.wrapX = int32_t(aTileRect.x * mBaseFrequency.width) + stitch.width;
stitch.wrapY = int32_t(aTileRect.y * mBaseFrequency.height) + stitch.height;
return stitch;

Просмотреть файл

@ -110,8 +110,8 @@ DecomposeIntoNoRepeatTriangles(const gfx::IntRect& aTexCoordRect,
NS_ASSERTION(!xwrap || xlen > 0.0f, "xlen isn't > 0, what's going on?");
NS_ASSERTION(!ywrap || ylen > 0.0f, "ylen isn't > 0, what's going on?");
NS_ASSERTION(aTexCoordRect.width <= aTexSize.width &&
aTexCoordRect.height <= aTexSize.height, "tex coord rect would cause tiling!");
NS_ASSERTION(aTexCoordRect.Width() <= aTexSize.width &&
aTexCoordRect.Height() <= aTexSize.height, "tex coord rect would cause tiling!");
if (!xwrap && !ywrap) {
aRects.addRect(0.0f, 0.0f,

Просмотреть файл

@ -359,9 +359,9 @@ gfx::IntRect TiledTextureImage::GetSrcTileRect()
{
gfx::IntRect rect = GetTileRect();
const bool needsYFlip = mFlags & OriginBottomLeft;
unsigned int srcY = needsYFlip ? mSize.height - rect.height - rect.y
unsigned int srcY = needsYFlip ? mSize.height - rect.Height() - rect.y
: rect.y;
return gfx::IntRect(rect.x, srcY, rect.width, rect.height);
return gfx::IntRect(rect.x, srcY, rect.Width(), rect.Height());
}
void

Просмотреть файл

@ -506,8 +506,8 @@ UploadImageDataToTexture(GLContext* gl,
0,
rect.x,
rect.y,
rect.width,
rect.height,
rect.Width(),
rect.Height(),
aStride,
pixelSize,
format,

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше