Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Перейти к файлу
Tom Houlé 6ec0bcc5f5 servo: Merge #16229 - style: Do not immediately convert absolute specified lengths (from tomhoule:fix-lengths); r=emilio
<!-- Please describe your changes on the following line: -->

This PR aims to solve issue #15729. I tried to follow the recommendations there as much as possible.

This is my first attempt at contributing to Servo, so this will probably need a lot of input, although I'm eager to make it as polished as possible.

- The base inaccuracy issue seems solved, as can be easily verified with the `console.log` based example in the issue.
- Very basic unit tests were added.

I have doubts mainly about the right way to represent these new enum variants for the various length units:

1. With new enum variants in `NoCalcLength` *and* newtypes (current solution)
2. With a `NoCalcLength::Absolute` variant that contains a new `AbsoluteLength` enum, but without newtypes
3. Same as solution 2 but with newtypes

- I mostly cared about unit tests until now but will investigate other types of tests
- Tests to check the clamping
- Write a proper commit message

Thanks for your time and feedback :)

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15729.

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: c8cd70f333d41864ff7bf7dce84301509c71d1d6

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : f88bfc0da8ae25a1647f8bcacf05c08694bbeb92
2017-04-12 01:16:32 -05:00
.cargo Bug 1277338 - Part 1: Turn js/src into the mozjs-sys crate; r=sfink 2016-10-13 16:12:42 -07:00
.vscode Bug 1341585 - Ignore Visual Studio Code workspace settings and add a recommended extensions file. r=gps,jya 2017-02-22 12:57:57 +01:00
accessible Bug 1354293 - Don't try to build a11y IPC code that depends on accessibility being enabled. r=aklotz 2017-04-06 18:51:02 -04:00
addon-sdk Bug 1353104 - use HiddenFrame.jsm to create frames for add-on sdk add-ons, r=kmag 2017-04-03 21:25:16 +01:00
b2g Bug 1354395 - Update sixgill to a rebuild that links against GMP statically. r=sfink 2017-04-11 17:28:10 +09:00
browser Merge mozilla-central to autoland 2017-04-12 11:18:49 +08:00
build merge mozilla-inbound to mozilla-central a=merge 2017-04-12 11:16:46 +08:00
caps Bug 1346713 - Generate unique firstPartyDomain value for NullPrincipal. r=smaug 2017-04-11 16:48:34 +08:00
chrome Bug 1345696 part 1 - Lots of fixup for the next patch. r=heycam 2017-03-28 20:05:12 +11:00
config Merge mozilla-central to mozilla-inbound 2017-04-07 15:33:03 +02:00
db Bug 1352260 - Upgrade to SQLite 3.18.0. r=mak 2017-04-01 15:08:18 -04:00
devtools Backed out changeset c844ec70bdb4 (bug 1342178) for frequently timing out in test_network_security.html on Linux. r=backout a=backout 2017-04-11 11:28:59 +02:00
docshell Bug 1350496 - add BUG_COMPONENT to docshell/* files. r=overholt 2017-04-09 05:43:52 -04:00
dom Bug 1296220 Rename nsIMEUpdatePreference to mozilla::widget::IMEUpdatePreference r=m_kato 2017-04-11 21:24:55 +09:00
editor Bug 1315874 - Drop 'ForElement' from GetStyleContextForElementXXX methods; r=heycam 2017-04-05 14:39:23 +09:00
embedding Backed out 3 changesets (bug 1344038) for bustage 2017-04-06 10:35:56 +08:00
extensions Backed out 3 changesets (bug 1344038) for bustage 2017-04-06 10:35:56 +08:00
gfx Bug 1355654 - VRManager will now wait for 30 seconds of inactivity before releasing VR displays, rather than doing it instantaneously. r=daoshengmu 2017-04-11 22:12:22 -07:00
gradle/wrapper Bug 1300094 - Update Gradle to 2.14.1 and Gradle Plugin to 2.1.3 r=sebastian 2016-09-22 14:31:01 -07:00
hal Bug 1194751 - Part 3. Remove unused nsIScreen::rotation attribute. r=jimm 2017-03-09 19:16:33 +08:00
image Bug 1354499. Enable test_discardAnimatedImage.html. 2017-04-08 15:58:17 -05:00
intl Backed out changeset 72858bb2ed9d (bug 1351427) for leaks detected by Linux x64 asan. r=backout 2017-04-11 21:11:09 +02:00
ipc Bug 1350638 - Remove the GetCompositorOptions IPC message as it is no longer used. r=dvander 2017-04-09 17:31:59 -04:00
js Merge mozilla-central to autoland 2017-04-12 11:18:49 +08:00
layout Bug 1344991 - Continue reftest after a crash r=dbaron,jmaher 2017-03-09 10:49:20 +08:00
media Bug 1349883 - part 3: resolve decode promise according to buffer status. r=jya 2017-04-07 17:07:02 +08:00
memory Bug 1332747 Change MOZ_ALWAYS_INLINE to MOZ_ALWAYS_INLINE_EVEN_DEBUG to fix MinGW Debug build r=froydnj 2017-04-11 12:53:58 -05:00
mfbt Bug 1353324 - Add const char16_t variant of MakeCStringSpan() and rename both to MakeStringSpan(). r=froydnj. 2017-04-04 14:04:14 +03:00
mobile Bug 1349883 - part 3: resolve decode promise according to buffer status. r=jya 2017-04-07 17:07:02 +08:00
modules Bug 1343374 - Enable OpenVR by default on Windows r=daoshengmu 2017-04-11 16:02:59 -07:00
mozglue Merge m-c to a CLOSED TREE m-i 2017-04-06 21:16:43 -07:00
netwerk merge mozilla-inbound to mozilla-central a=merge 2017-04-12 11:16:46 +08:00
nsprpub Bug 1350291, uplift NSPR_4_15_BETA, r=franziskus 2017-03-24 14:58:00 +01:00
other-licenses Bug 1345530 - add BUG_COMPONENT to other-licenses/* files. r=tbsaunde, mhowell, overholt 2017-04-05 08:31:10 -04:00
parser merge mozilla-inbound to mozilla-central a=merge 2017-04-12 11:16:46 +08:00
probes Bug 1344878 - add BUG_COMPONENT to probes/* files. r=Ms2ger 2017-03-24 09:50:48 -04:00
python Bug 1352815 - "codegen-units = 4" for Rust code in debug mode r=froydnj 2017-04-02 14:17:44 +02:00
rdf Bug 1353143 - Part 5: Replace direct usage of PR_LogPrint. r=froydnj 2017-04-04 14:36:21 -07:00
security No bug, Automated HPKP preload list update from host bld-linux64-spot-303 - a=hpkp-update 2017-04-11 08:57:53 -07:00
services Bug 595314 - Add TPS test ensuring that new changes to existing bookmarks are respected by sync r=markh 2017-04-05 12:39:00 -04:00
servo servo: Merge #16229 - style: Do not immediately convert absolute specified lengths (from tomhoule:fix-lengths); r=emilio 2017-04-12 01:16:32 -05:00
startupcache Backed out changeset 7fdcabdbb675 (bug 1024669) for failing mda, GTest and talos jobs. r=backout on a CLOSED TREE 2017-04-10 19:05:44 +02:00
storage Bug 1007034 - Add console warnings for the deprecated BindXXXParameter methods in mozIStorageBaseStatement and replace calls to the deprecated methods in dom/indexedDB/ActorsParent.cpp. r=mak 2017-04-05 14:08:25 -04:00
taskcluster Merge mozilla-central to autoland 2017-04-12 11:18:49 +08:00
testing Merge mozilla-central to autoland 2017-04-12 11:18:49 +08:00
third_party/rust No bug - Revendor rust dependencies 2017-04-07 06:46:39 +00:00
toolkit Bug 1311933 - P2. Add telemetry to measure if completion match type is the same for v2 and v4. r=francois 2017-04-12 09:11:18 +08:00
tools Bug 1341423 - Integrate OpenVR binding library r=daoshengmu 2017-02-27 16:59:30 -08:00
uriloader Bug 1350026 - Fix recognition of the handler type in the JSON handler service back-end, and add detailed testing of the file format. r=mak 2017-04-04 17:20:37 +01:00
view Bug 1351904 - Switch layout over to ArenaAllocator. r=xidorn 2017-03-31 14:06:33 -07:00
widget Bug 1296220 Rename nsIMEUpdatePreference to mozilla::widget::IMEUpdatePreference r=m_kato 2017-04-11 21:24:55 +09:00
xpcom Backed out changeset 7fdcabdbb675 (bug 1024669) for failing mda, GTest and talos jobs. r=backout on a CLOSED TREE 2017-04-10 19:05:44 +02:00
xpfe Bug 1354068: fix uninitialized rv in some paths in nsWebShellWindow r=bdahl 2017-04-06 23:23:44 -04:00
.clang-format Bug 1322321 - Update the clang format file to match more our coding style r=ehsan 2016-12-06 17:43:17 -10:00
.clang-format-ignore Bug 1341423 - Integrate OpenVR binding library r=daoshengmu 2017-02-27 16:59:30 -08:00
.clang-tidy Bug 1319396 - Update the list of checkers in the .clang-tidy file r=Ehsan 2016-11-22 12:30:19 +01:00
.cron.yml Bug 1351306 - Move the UTC starttime of nightlies earlier. r=rail 2017-03-28 09:56:30 -04:00
.eslintignore Merge inbound to central, a=merge 2017-04-03 14:50:18 -07:00
.eslintrc.js Bug 1352969 - Improve ESLint environment browser-window globals list, and automatically inject it into browser-window scripts. r=mossop 2017-03-09 17:17:26 +00:00
.flake8 Bug 1321956 - Disable flake8 check for 'visually indented line with same indent as next logical line', r=ahal 2016-12-08 09:53:21 -10:00
.gdbinit Bug 1317802 - don't stop for SIGSYS in .gdbinit; r=jld 2016-11-16 01:13:22 -05:00
.gdbinit_python bug 985566 - add some pretty printers to .gdbinit r=froydnj r=glandium 2016-06-02 13:33:07 -04:00
.gitignore Bug 1305023 - Move ESLint's package.json and node_modules to the top level to improve editor integration. r=gps 2017-03-22 12:27:00 +01:00
.hgignore Bug 1305023 - Move ESLint's package.json and node_modules to the top level to improve editor integration. r=gps 2017-03-22 12:27:00 +01:00
.hgtags No bug - Tagging mozilla-central 6583496f169cd8a13c531ed16e98e8bf313eda8e with FIREFOX_AURORA_54_BASE a=release DONTBUILD CLOSED TREE 2017-03-06 23:43:32 +01:00
.lldbinit Bug 1254128 - Make the Mozilla .lldbinit use the full path for topsrcdir. r=sparky 2016-03-01 16:36:08 +00:00
.taskcluster.yml bug 1350045 - add warning to decision docker image line. r=philor 2017-03-25 12:10:32 -07:00
.ycm_extra_conf.py Bug 1293534: Fix .ycm_extra_conf after bug 1195748. r=gps 2016-08-09 10:30:58 -07:00
AUTHORS Bug 1349980 - update task generation to support -g in try syntax for running OS X tasks in generic-worker,r=dustin 2017-04-06 18:50:41 +02:00
Android.mk
CLOBBER Bug 1351074 followup, touch CLOBBER to really get AsyncSpellCheckTestHelper.jsm removed 2017-04-03 22:35:44 -07:00
GNUmakefile
LEGAL
LICENSE
Makefile.in Bug 1337986 - Dump symbols during the compile tier. r=ted 2017-02-10 08:34:08 -08:00
README.txt Bug 1349108 - Update links in README.txt to HTTPS r=RyanVM 2017-03-21 00:11:02 -04:00
aclocal.m4 Bug 1262155 - Use moz.build instead of libffi's build system. r=ted,glandium 2016-08-08 16:58:54 -07:00
build.gradle Bug 1318823 - Use com.getkeepsafe.dexcount in Gradle builds. r=sebastian 2016-11-18 18:28:58 -08:00
client.mk Bug 1317778 - Emit a depfile with python configure dependencies so Make will know when to re-run configure. r=glandium 2016-12-02 10:05:57 -08:00
client.py
configure.in Bug 1295751 - Make it possible to copy configure.in to configure. r=gps 2016-08-16 19:35:00 -07:00
configure.py Bug 1316140 - Allow use of multiprocessing from config.status on windows. r=mshal 2016-12-21 16:28:28 -08:00
gradle.properties
gradlew
mach Bug 1316140 - Allow use of multiprocessing from config.status on windows. r=mshal 2016-12-21 16:28:28 -08:00
moz.build Bug 1262241 - Move the definition of the js library to a subdirectory. r=mshal 2017-04-04 11:43:14 +09:00
moz.configure Bug 1347191 - Add support for NSIS 3.01 to moz.configure. r=mhowell 2017-03-28 10:53:17 -04:00
mozilla-config.h.in
npm-shrinkwrap.json Bug 1305023 - Move ESLint's package.json and node_modules to the top level to improve editor integration. r=gps 2017-03-22 12:27:00 +01:00
old-configure.in Backed out 3 changesets (bug 1344038) for bustage 2017-04-06 10:35:56 +08:00
package.json Bug 1305023 - Move ESLint's package.json and node_modules to the top level to improve editor integration. r=gps 2017-03-22 12:27:00 +01:00
settings.gradle Bug 1291363 - Add geckoview and geckoview_example Gradle projects. r=jchen,sebastian 2016-10-05 20:23:38 -07:00
test.mozbuild

README.txt

An explanation of the Mozilla Source Code Directory Structure and links to
project pages with documentation can be found at:

    https://developer.mozilla.org/en/Mozilla_Source_Code_Directory_Structure

For information on how to build Mozilla from the source code, see:

    https://developer.mozilla.org/en/docs/Build_Documentation

To have your bug fix / feature added to Mozilla, you should create a patch and
submit it to Bugzilla (https://bugzilla.mozilla.org). Instructions are at:

    https://developer.mozilla.org/en/docs/Creating_a_patch
    https://developer.mozilla.org/en/docs/Getting_your_patch_in_the_tree

If you have a question about developing Mozilla, and can't find the solution
on https://developer.mozilla.org, you can try asking your question in a
mozilla.* Usenet group, or on IRC at irc.mozilla.org. [The Mozilla news groups
are accessible on Google Groups, or news.mozilla.org with a NNTP reader.]

You can download nightly development builds from the Mozilla FTP server.
Keep in mind that nightly builds, which are used by Mozilla developers for
testing, may be buggy. Firefox nightlies, for example, can be found at:

    https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/
            - or -
    https://nightly.mozilla.org/