From 3850bfcb248a64732627ac24310fd951ff157ce2 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Fri, 14 Jul 2023 10:13:12 +0800 Subject: [PATCH] import changes from `dev' branch of rmottola/Arctic-Fox: - Bug 1228921 - Write nsChangeHint constants using left shifts. r=xidorn (cc7702d508) - Bug 1228921 patch 2 - Fix nsRestyleHint constants to match the same style. r=xidorn (1ec516e7fb) - Bug 1077085 - Insure puppet widgets don't skip sending resize notifications to the view manager when the user navigates through history items. r=tn (6ebc5e2ec4) - Bug 1188665 - Make nsIDOMWindowUtils.disableDialogs() disable onbeforeunload dialogs. r=bz (c1832372ff) - fix misspatch in Bug 1224464 patch 2 (710f8de1ae) - Bug 1175192. Consistently allow identifiers to start with -- in the CSS parser. r=heycam (5c4ced2937) - Bug 1220903 - Allow style to access chrome-only properties if it is loaded via chrome protocol. r=bz (155b2099cc) - Bug 1217643 part 0: Add reftests for -webkit-gradient() expressions. r=heycam (adc23dade1) - Bug 1217643 part 1: Add partial support for parsing CSS -webkit-gradient expressions (if webkit prefix support is enabled). r=heycam (715c0364b2) - Bug 1217643 part 2: Represent parsed CSS -webkit-gradient(linear, ...) expressions internally as parsed versions of more modern syntax. r=heycam (2f06829293) - Bug 1217643 part 3: Represent parsed CSS -webkit-gradient(radial, ...) expressions internally as parsed versions of more modern syntax. r=heycam (f2903d9cec) - Bug 1228051 - Remove PR_snprintf calls in nsCSSParser.cpp's CSSParserImpl::ParseColor. r=dholbert (f3845e9bac) - Bug 1221823 patch 1 - Use rvalue-reference and Move rather than just comments to show behavior of nsCSSKeyframeRule constructor. r=xidorn (07196fd12f) - Bug 1221823 patch 2 - Use already_AddRefed&& as parameter to nsCSSKeyframeRule constructor to avoid extra reference count cycle. r=xidorn (c4b441fc83) - Bug 1232596 - initialize variable changed = false, flagged by Coverity. r=dbaron (1e662aea38) - (no bug) Fix typo (repeated word) in comment. comment-only, no review, DONTBUILD (dbb43c2638) - Bug 1213842 - :lang() should not fall back to HTTP headers if empty lang attribute is specified; r=bz (6992d47faa) - bits of Bug 1202744 - Overlapping software home buttons r=snorp (5913a799f1) - Bug 1171368 - Fix -Wunreachable-code-break warning in layout/style/nsCSSRuleProcessor.cpp. r=dholbert (2d006c9e7e) - Bug 1202512 - Part 3: Restyle elements with attribute/state changes if we find a conditionally restyled ancestor while selector matching up the tree. r=bzbarsky (ea671029bb) - Bug 1202512 - Part 4: Reftests. r=bzbarsky (418aae6b65) - Bug 1097242 - Make sure contenteditable -moz-user-select styles can be overridden by web pages; r=dbaron (c1a0172841) - Bug 1166969 - Video element in the video document shouldn't be selected. r=roc (fb9621837b) - Bug 1169901 - View source menu covers full height. r=heycam (6225279b1a) - Bug 1230508 - Always compute position to fixed for top layer elements for now. r=dbaron (55475be4f2) - Bug 1230508 - Always compute position to fixed for top layer elements for now. r=dbaron (10a918d358) - Bug 1216362 - Measure nsCSSSelector::mAttrList. r=erahm (110a191205) - Bug 1156392 - Remove an ifdef condition that we don't need any more. r=tn (84f9f7748d) - Bug 1215957 - Start at the end of the explicit grid also when matching plain negative number lines. r=dholbert (21b56f9b66) - Bug 1226697 part 1 - [css-grid] Fix off-by-one error when counting lines in reverse. r=dholbert (b8293a7c4b) - Bug 1211260 - Implement the new Grid Placement Conflict Handling: "If the placement for a grid item contains two lines, and the start line is further end-ward than the end line, swap the two lines." r=dholbert (a740de6866) - Bug 1211260 - [css-grid] Follow-up: address a code readability nit that I missed. r=dholbert (d98517d455) - Bug 1215099 part 2 - [css-grid] An empty grid should still have one explicit grid line in each axis. r=dholbert (8b80702949) - Bug 1230695 - [css-grid] abs.pos. child spanning from an 'auto' start position to an end line should end on the start side of the gutter. r=dholbert (02dfb8610a) - Bug 1229145 - [css-grid] Account for start margin when calculating border box offset for align-self/justify-self:center. r=dholbert (f4b030f775) - Bug 1224634 - [css-grid] Tweak a few tests to account for correct 'justify-self' behavior. (2fa37ac545) - Bug 1229145 - [css-grid] Adjust align-self/justify-self:center reference rendering to reflect the corrected margin calculations. (c95ab49645) - Bug 1225118 - [css-grid] Deal with nscoord overflow when applying [align|justify]-self:stretch. r=dholbert (9db2a3b1ca) - Bug 1225118 - Crashtest. (71d85472da) - Bug 1227216. Part 1: Only draw surface on inset box shadows if dest and src are equal sizes. r=mstange (6adb32966c) - Bug 1227216. Part 2: Fallback to blur destination rect if a large shadow offset occurs. r=mstange (bfad4ecb03) - Bug 1178575 - tests. (519597225f) - Bug 1212823 - Use correct coordinate space for box-shadow native rect when doing themed drawing. r=roc (25ab30fa1a) - Bug 1229165 - [css-grid] Apply min/max-width/height properties to clamp block-size of auto-height grid containers. r=dholbert (eaf4864e88) - Bug 1228984 - [css-grid] Auto-placement into columns missed some unoccupied span-1 column slots. r=dholbert (e6bbc62ca6) - Bug 1228984 - [css-grid] Add more auto-placement tests. (6c2bfceefd) - Bug 1215182 - [css-grid] Make our "Implicit Named Areas" detection match the spec. r=dholbert (a31e1afe0f) - Bug 1215182 - Reftests. (22e235d090) - Bug 957911 - Work around the lack of support for semi-colon comments in python/configobj. r=gps (3f65ecdb57) - Bug 1194121 - Skip UpdateCommands() from initializing collapse to avoid sync IPC during app startup. r=jst (f84caa230a) - Bug 1170642 - Silence nsDocumentViewer::GetInImage warnings. r=ehsan (1e652f7f35) - No bug, use attached widget listener mode on iOS, NPOTB (394650156a) - Bug 1191609 - Always stroke CSS border sides separately from corner fills. r=mstange (c84f179c91) - Bug 1224761 - Fix forceRepeatToCoverTiles optimization to not trigger when all stops at left edge of tile. r=roc (8a95296996) - Bug 1155766 - Fix a bad assertion r=jfkthame (db12ebcfab) - Bug 1163583 - Update SetPara with recent changes to ICU algorithm. r=smontagu (29250e8018) - Bug 1157727 - Part 0: Preliminary cleanup, remove a bunch of #ifdef'd dead code from nsBidi.cpp. r=smontagu (b6b1bafd0c) - Bug 1157727 - Part 1: Add paired bracket type property to our character data (patch originally by :tedders1, updated by :jfkthame). r=jfkthame (dd3b21469a) - Bug 1161932 - Fix coverity warning in nsBidi.cpp. r=smontagu (8c5e758aad) - Bug 1217833 - Fix container width in exception for line frames in nsBidiPresUtils::ReorderFrames. r=jfkthame (b59949333a) - Bug 1217833 followup - Mark one test as fuzzy(43,2) on a CLOSED TREE (though fuzzy amounts needed vary by platform). (241f74b354) - Bug 1217833 followup - Add margin to avoid fuzz on reftest. (e885281263) - Bug 1157727 - Reftests for bidi bracket pairing, based on UAX #9 examples. r=smontagu (a6865a934c) - Bug 1157727 - Part 2: Update bidi algorithm for bracket matching (patch originally by :tedders1, updated by :jfkthame). r=jfkthame (1bf541ba42) - Bug 1169088 - Remove unused nsBidiPresUtils methods. r=dbaron (27a86233bc) - Bug 817406 part 1 - Let ApplyStyleFixups propogate 'direction' to the viewport. r=bz,heycam (9370d38caf) - Bug 1210877 - Make nsBidiPresUtils::RepositionFrame work also for box-decoration-break:clone. r=roc (ec5d29a8a1) - Bug 1162813: filter paragraph separators before passing text to SetPara, r=jfkthame (4b0fa94ac8) - Bug 1146112 - Mark ruby pseudo frames as line participant in frame constructor. r=roc (ae06cf850f) - Bug 1228033. When not painting to a window (and hence not retained) only have one AGR, the root AGR. r=mattwoodrow (f640ec9a8c) - Bug 927228 - Allow ImageLayerization for images using 'contain' and 'cover'. r=mstange (23863c225a) - Bug 1230696 - Don't report perspective values that round to 0 app units as not having perspective. r=roc (9f70c1d9d8) - Bug 1230075 - Allow perspective items in hittest() for preserve-3d cases. r=mattwoodrow (75d585b042) - Bug 1141636 - "Dubious loop test in nsSVGElement::GetAnimatedLengthListValues". r=cam f=longsonr (339c880389) --- config/printconfigsetting.py | 10 +- dom/base/nsIContent.h | 9 +- gfx/thebes/gfxBlur.cpp | 41 +- gfx/thebes/gfxBlur.h | 2 + .../tools/genUnicodePropertyData.pl | 46 +- intl/unicharutil/util/nsUnicodeProperties.cpp | 20 + intl/unicharutil/util/nsUnicodeProperties.h | 10 + .../util/nsUnicodePropertyData.cpp | 51 +- intl/unicharutil/util/nsUnicodeScriptCodes.h | 7 +- layout/base/crashtests/crashtests.list | 1 + layout/base/nsBidi.cpp | 1286 ++++++----------- layout/base/nsBidi.h | 355 ++--- layout/base/nsBidiPresUtils.cpp | 174 +-- layout/base/nsBidiPresUtils.h | 28 - layout/base/nsCSSFrameConstructor.cpp | 18 +- layout/base/nsCSSRendering.cpp | 6 +- layout/base/nsCSSRenderingBorders.cpp | 45 +- layout/base/nsChangeHint.h | 74 +- layout/base/nsDisplayList.cpp | 40 +- layout/base/nsDocumentViewer.cpp | 53 +- layout/base/tests/browser.ini | 1 + .../browser_disableDialogs_onbeforeunload.js | 54 + layout/base/tests/bug1097242-1-ref.html | 14 + layout/base/tests/bug1097242-1.html | 18 + layout/base/tests/mochitest.ini | 2 + .../base/tests/test_reftests_with_caret.html | 1 + layout/generic/crashtests/1225118.html | 4 + layout/generic/crashtests/crashtests.list | 1 + layout/generic/nsGfxScrollFrame.cpp | 4 +- layout/generic/nsGridContainerFrame.cpp | 158 +- layout/reftests/bidi/1217833-1-ref.html | 16 + layout/reftests/bidi/1217833-1.html | 18 + layout/reftests/bidi/1217833-2-ref.html | 21 + layout/reftests/bidi/1217833-2.html | 23 + layout/reftests/bidi/817406-1-ref.html | 4 + layout/reftests/bidi/817406-1.html | 4 + layout/reftests/bidi/817406-2-ref.html | 4 + layout/reftests/bidi/817406-2.html | 4 + layout/reftests/bidi/817406-3.html | 6 + layout/reftests/bidi/817406-4-ref.html | 6 + layout/reftests/bidi/817406-4.html | 6 + layout/reftests/bidi/brackets-1a-ltr-ref.html | 15 + layout/reftests/bidi/brackets-1a-ltr.html | 16 + layout/reftests/bidi/brackets-1a-rtl-ref.html | 15 + layout/reftests/bidi/brackets-1a-rtl.html | 16 + layout/reftests/bidi/brackets-1b-ltr-ref.html | 15 + layout/reftests/bidi/brackets-1b-ltr.html | 16 + layout/reftests/bidi/brackets-1b-rtl-ref.html | 15 + layout/reftests/bidi/brackets-1b-rtl.html | 16 + layout/reftests/bidi/brackets-1c-ltr-ref.html | 15 + layout/reftests/bidi/brackets-1c-ltr.html | 16 + layout/reftests/bidi/brackets-1c-rtl-ref.html | 15 + layout/reftests/bidi/brackets-1c-rtl.html | 16 + layout/reftests/bidi/brackets-2a-ltr-ref.html | 15 + layout/reftests/bidi/brackets-2a-ltr.html | 16 + layout/reftests/bidi/brackets-2a-rtl-ref.html | 15 + layout/reftests/bidi/brackets-2a-rtl.html | 16 + layout/reftests/bidi/brackets-2b-ltr-ref.html | 15 + layout/reftests/bidi/brackets-2b-ltr.html | 16 + layout/reftests/bidi/brackets-2b-rtl-ref.html | 15 + layout/reftests/bidi/brackets-2b-rtl.html | 16 + layout/reftests/bidi/brackets-2c-ltr-ref.html | 15 + layout/reftests/bidi/brackets-2c-ltr.html | 16 + layout/reftests/bidi/brackets-2c-rtl-ref.html | 15 + layout/reftests/bidi/brackets-2c-rtl.html | 16 + layout/reftests/bidi/brackets-3a-ltr-ref.html | 15 + layout/reftests/bidi/brackets-3a-ltr.html | 16 + layout/reftests/bidi/brackets-3a-rtl-ref.html | 15 + layout/reftests/bidi/brackets-3a-rtl.html | 16 + layout/reftests/bidi/brackets-3b-ltr-ref.html | 16 + layout/reftests/bidi/brackets-3b-ltr.html | 16 + layout/reftests/bidi/brackets-3b-rtl-ref.html | 16 + layout/reftests/bidi/brackets-3b-rtl.html | 16 + layout/reftests/bidi/reftest.list | 22 + layout/reftests/box-shadow/1178575-2-ref.html | 29 + layout/reftests/box-shadow/1178575-2.html | 35 + layout/reftests/box-shadow/1178575-ref.html | 22 + layout/reftests/box-shadow/1178575.html | 28 + layout/reftests/box-shadow/1212823-1-ref.html | 7 + layout/reftests/box-shadow/1212823-1.html | 6 + .../boxshadow-inset-neg-spread2-ref.html | 16 + .../boxshadow-inset-neg-spread2.html | 20 + .../boxshadow-large-offset-ref.html | 50 + .../box-shadow/boxshadow-large-offset.html | 49 + layout/reftests/box-shadow/reftest.list | 5 + layout/reftests/bugs/1202512-1-ref.html | 2 + layout/reftests/bugs/1202512-1.html | 13 + layout/reftests/bugs/1202512-2-ref.html | 2 + layout/reftests/bugs/1202512-2.html | 13 + layout/reftests/bugs/reftest.list | 2 + .../box-decoration-break-with-bidi-ref.html | 74 + .../box-decoration-break-with-bidi.html | 64 + layout/reftests/css-break/reftest.list | 1 + .../reftests/css-gradients/1224761-1-ref.html | 37 + layout/reftests/css-gradients/1224761-1.html | 36 + layout/reftests/css-gradients/reftest.list | 1 + .../css-grid/grid-abspos-items-001-ref.html | 2 +- .../css-grid/grid-abspos-items-002-ref.html | 2 +- .../css-grid/grid-abspos-items-011-ref.html | 82 ++ .../css-grid/grid-abspos-items-011.html | 97 ++ ...grid-auto-min-sizing-definite-001-ref.html | 2 +- .../grid-col-max-sizing-max-content-001.html | 2 +- .../grid-col-max-sizing-max-content-002.html | 1 - .../css-grid/grid-item-align-001-ref.html | 56 +- .../css-grid/grid-item-align-002-ref.html | 12 +- .../css-grid/grid-item-align-003-ref.html | 13 +- .../css-grid/grid-item-justify-001-ref.html | 6 +- .../css-grid/grid-item-justify-002-ref.html | 4 +- .../css-grid/grid-max-sizing-flex-001.html | 2 +- .../css-grid/grid-max-sizing-flex-002.html | 2 +- .../css-grid/grid-max-sizing-flex-003.html | 2 +- .../css-grid/grid-max-sizing-flex-004.html | 1 - ...rid-placement-abspos-implicit-001-ref.html | 4 +- ...grid-placement-auto-col-dense-001-ref.html | 40 +- .../grid-placement-auto-col-dense-001.html | 40 +- ...grid-placement-auto-row-dense-001-ref.html | 60 +- .../grid-placement-auto-row-dense-001.html | 59 +- ...rid-placement-auto-row-sparse-001-ref.html | 33 +- .../grid-placement-auto-row-sparse-001.html | 31 +- .../grid-placement-definite-implicit-001.html | 1 + ...d-placement-definite-implicit-002-ref.html | 30 +- ...lacement-implicit-named-areas-001-ref.html | 157 ++ ...id-placement-implicit-named-areas-001.html | 159 ++ layout/reftests/css-grid/reftest.list | 2 + layout/reftests/css-parsing/reftest.list | 1 + .../css-parsing/two-dash-identifiers-ref.html | 12 + .../css-parsing/two-dash-identifiers.html | 22 + layout/reftests/reftest.list | 3 + layout/reftests/webkit-gradient/reftest.list | 21 + .../webkit-gradient-approx-linear-1-ref.html | 68 + .../webkit-gradient-approx-linear-1.html | 73 + .../webkit-gradient-approx-radial-1-ref.html | 62 + .../webkit-gradient-approx-radial-1.html | 64 + .../webkit-gradient-linear-1-ref.html | 51 + .../webkit-gradient-linear-1a.html | 67 + .../webkit-gradient-linear-1b.html | 67 + .../webkit-gradient-linear-1c.html | 67 + .../webkit-gradient-linear-1d.html | 67 + .../webkit-gradient-linear-2-ref.html | 61 + .../webkit-gradient-linear-2.html | 80 + .../webkit-gradient-radial-1-ref.html | 71 + .../webkit-gradient-radial-1a.html | 114 ++ .../webkit-gradient-radial-1b.html | 114 ++ .../webkit-gradient-radial-2-ref.html | 49 + .../webkit-gradient-radial-2.html | 62 + layout/style/RuleProcessorCache.h | 4 +- layout/style/StyleRule.cpp | 18 +- layout/style/StyleRule.h | 2 + layout/style/TopLevelVideoDocument.css | 1 + layout/style/contenteditable.css | 26 +- layout/style/nsCSSParser.cpp | 507 ++++++- layout/style/nsCSSProps.cpp | 2 +- layout/style/nsCSSRuleProcessor.cpp | 36 +- layout/style/nsCSSRules.h | 10 +- layout/style/nsCSSScanner.cpp | 2 +- layout/style/nsRuleNode.cpp | 10 +- layout/style/viewsource.css | 7 +- layout/svg/SVGTextFrame.cpp | 2 +- .../the-lang-attribute-009.html.ini | 5 - .../the-lang-attribute-010.html.ini | 5 - .../shared/in-content/info-pages.inc.css | 30 +- 161 files changed, 4777 insertions(+), 1665 deletions(-) create mode 100644 layout/base/tests/browser_disableDialogs_onbeforeunload.js create mode 100644 layout/base/tests/bug1097242-1-ref.html create mode 100644 layout/base/tests/bug1097242-1.html create mode 100644 layout/generic/crashtests/1225118.html create mode 100644 layout/reftests/bidi/1217833-1-ref.html create mode 100644 layout/reftests/bidi/1217833-1.html create mode 100644 layout/reftests/bidi/1217833-2-ref.html create mode 100644 layout/reftests/bidi/1217833-2.html create mode 100644 layout/reftests/bidi/817406-1-ref.html create mode 100644 layout/reftests/bidi/817406-1.html create mode 100644 layout/reftests/bidi/817406-2-ref.html create mode 100644 layout/reftests/bidi/817406-2.html create mode 100644 layout/reftests/bidi/817406-3.html create mode 100644 layout/reftests/bidi/817406-4-ref.html create mode 100644 layout/reftests/bidi/817406-4.html create mode 100644 layout/reftests/bidi/brackets-1a-ltr-ref.html create mode 100644 layout/reftests/bidi/brackets-1a-ltr.html create mode 100644 layout/reftests/bidi/brackets-1a-rtl-ref.html create mode 100644 layout/reftests/bidi/brackets-1a-rtl.html create mode 100644 layout/reftests/bidi/brackets-1b-ltr-ref.html create mode 100644 layout/reftests/bidi/brackets-1b-ltr.html create mode 100644 layout/reftests/bidi/brackets-1b-rtl-ref.html create mode 100644 layout/reftests/bidi/brackets-1b-rtl.html create mode 100644 layout/reftests/bidi/brackets-1c-ltr-ref.html create mode 100644 layout/reftests/bidi/brackets-1c-ltr.html create mode 100644 layout/reftests/bidi/brackets-1c-rtl-ref.html create mode 100644 layout/reftests/bidi/brackets-1c-rtl.html create mode 100644 layout/reftests/bidi/brackets-2a-ltr-ref.html create mode 100644 layout/reftests/bidi/brackets-2a-ltr.html create mode 100644 layout/reftests/bidi/brackets-2a-rtl-ref.html create mode 100644 layout/reftests/bidi/brackets-2a-rtl.html create mode 100644 layout/reftests/bidi/brackets-2b-ltr-ref.html create mode 100644 layout/reftests/bidi/brackets-2b-ltr.html create mode 100644 layout/reftests/bidi/brackets-2b-rtl-ref.html create mode 100644 layout/reftests/bidi/brackets-2b-rtl.html create mode 100644 layout/reftests/bidi/brackets-2c-ltr-ref.html create mode 100644 layout/reftests/bidi/brackets-2c-ltr.html create mode 100644 layout/reftests/bidi/brackets-2c-rtl-ref.html create mode 100644 layout/reftests/bidi/brackets-2c-rtl.html create mode 100644 layout/reftests/bidi/brackets-3a-ltr-ref.html create mode 100644 layout/reftests/bidi/brackets-3a-ltr.html create mode 100644 layout/reftests/bidi/brackets-3a-rtl-ref.html create mode 100644 layout/reftests/bidi/brackets-3a-rtl.html create mode 100644 layout/reftests/bidi/brackets-3b-ltr-ref.html create mode 100644 layout/reftests/bidi/brackets-3b-ltr.html create mode 100644 layout/reftests/bidi/brackets-3b-rtl-ref.html create mode 100644 layout/reftests/bidi/brackets-3b-rtl.html create mode 100644 layout/reftests/box-shadow/1178575-2-ref.html create mode 100644 layout/reftests/box-shadow/1178575-2.html create mode 100644 layout/reftests/box-shadow/1178575-ref.html create mode 100644 layout/reftests/box-shadow/1178575.html create mode 100644 layout/reftests/box-shadow/1212823-1-ref.html create mode 100644 layout/reftests/box-shadow/1212823-1.html create mode 100644 layout/reftests/box-shadow/boxshadow-inset-neg-spread2-ref.html create mode 100644 layout/reftests/box-shadow/boxshadow-inset-neg-spread2.html create mode 100644 layout/reftests/box-shadow/boxshadow-large-offset-ref.html create mode 100644 layout/reftests/box-shadow/boxshadow-large-offset.html create mode 100644 layout/reftests/bugs/1202512-1-ref.html create mode 100644 layout/reftests/bugs/1202512-1.html create mode 100644 layout/reftests/bugs/1202512-2-ref.html create mode 100644 layout/reftests/bugs/1202512-2.html create mode 100644 layout/reftests/css-break/box-decoration-break-with-bidi-ref.html create mode 100644 layout/reftests/css-break/box-decoration-break-with-bidi.html create mode 100644 layout/reftests/css-gradients/1224761-1-ref.html create mode 100644 layout/reftests/css-gradients/1224761-1.html create mode 100644 layout/reftests/css-grid/grid-abspos-items-011-ref.html create mode 100644 layout/reftests/css-grid/grid-abspos-items-011.html create mode 100644 layout/reftests/css-grid/grid-placement-implicit-named-areas-001-ref.html create mode 100644 layout/reftests/css-grid/grid-placement-implicit-named-areas-001.html create mode 100644 layout/reftests/css-parsing/two-dash-identifiers-ref.html create mode 100644 layout/reftests/css-parsing/two-dash-identifiers.html create mode 100644 layout/reftests/webkit-gradient/reftest.list create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-approx-linear-1-ref.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-approx-linear-1.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-approx-radial-1-ref.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-approx-radial-1.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-linear-1-ref.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-linear-1a.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-linear-1b.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-linear-1c.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-linear-1d.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-linear-2-ref.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-linear-2.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-radial-1-ref.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-radial-1a.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-radial-1b.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-radial-2-ref.html create mode 100644 layout/reftests/webkit-gradient/webkit-gradient-radial-2.html delete mode 100644 testing/web-platform/meta/html/dom/elements/global-attributes/the-lang-attribute-009.html.ini delete mode 100644 testing/web-platform/meta/html/dom/elements/global-attributes/the-lang-attribute-010.html.ini diff --git a/config/printconfigsetting.py b/config/printconfigsetting.py index bdd6f2a2bc..ef900a6c05 100644 --- a/config/printconfigsetting.py +++ b/config/printconfigsetting.py @@ -2,7 +2,10 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -import configobj, sys +import configobj +import sys +import re +from StringIO import StringIO try: (file, section, key) = sys.argv[1:] @@ -10,7 +13,10 @@ except ValueError: print "Usage: printconfigsetting.py
" sys.exit(1) -c = configobj.ConfigObj(file) +with open(file) as fh: + content = re.sub('^\s*;', '#', fh.read(), flags=re.M) + +c = configobj.ConfigObj(StringIO(content)) try: s = c[section] diff --git a/dom/base/nsIContent.h b/dom/base/nsIContent.h index 078cb1138d..4f7ade14d3 100644 --- a/dom/base/nsIContent.h +++ b/dom/base/nsIContent.h @@ -920,11 +920,11 @@ public: mozilla::dom::Element* GetEditingHost(); /** - * Determing language. Look at the nearest ancestor element that has a lang + * Determining language. Look at the nearest ancestor element that has a lang * attribute in the XML namespace or is an HTML/SVG element and has a lang in - * no namespace attribute. + * no namespace attribute. Returns false if no language was specified. */ - void GetLang(nsAString& aResult) const { + bool GetLang(nsAString& aResult) const { for (const nsIContent* content = this; content; content = content->GetParent()) { if (content->GetAttrCount() > 0) { // xml:lang has precedence over lang on HTML elements (see @@ -939,10 +939,11 @@ public: NS_ASSERTION(hasAttr || aResult.IsEmpty(), "GetAttr that returns false should not make string non-empty"); if (hasAttr) { - return; + return true; } } } + return false; } // Overloaded from nsINode diff --git a/gfx/thebes/gfxBlur.cpp b/gfx/thebes/gfxBlur.cpp index 97d90a67a6..119af1532d 100644 --- a/gfx/thebes/gfxBlur.cpp +++ b/gfx/thebes/gfxBlur.cpp @@ -919,6 +919,8 @@ gfxAlphaBoxBlur::GetInsetBlur(IntMargin& aExtendDestBy, const RectCornerRadii& aInnerClipRadii, const Color& aShadowColor, const bool& aHasBorderRadius, + const Point aShadowOffset, + bool& aMovedOffset, gfxContext* aDestinationCtx) { if (!gBlurCache) { @@ -933,6 +935,19 @@ gfxAlphaBoxBlur::GetInsetBlur(IntMargin& aExtendDestBy, aShadowClipRect, aHasBorderRadius, aInnerClipRadii); + // If we have a shadow offset larger than the min rect, + // there's no clean way we can properly create a min rect with the offset + // in the correct place and still render correctly. In those cases, + // fallback to just rendering the dest rect as is. + bool useDestRect = (std::abs(aShadowOffset.x) > aSlice.left) || + (std::abs(aShadowOffset.y) > aSlice.top); + aMovedOffset = false; + if (useDestRect) { + aDestinationRect.ToIntRect(&outerRect); + aShadowClipRect.ToIntRect(&innerRect); + aMovedOffset = true; + } + DrawTarget* destDrawTarget = aDestinationCtx->GetDrawTarget(); BlurCacheData* cached = gBlurCache->LookupInsetBoxShadow(outerRect.Size(), innerRect.Size(), @@ -940,7 +955,7 @@ gfxAlphaBoxBlur::GetInsetBlur(IntMargin& aExtendDestBy, &aInnerClipRadii, aShadowColor, aHasBorderRadius, destDrawTarget->GetBackendType()); - if (cached) { + if (cached && !useDestRect) { aExtendDestBy = cached->mExtendDest; // Need to extend it twice: once for the outer rect and once for the inner rect. aSlice += aExtendDestBy; @@ -985,14 +1000,22 @@ gfxAlphaBoxBlur::GetInsetBlur(IntMargin& aExtendDestBy, IntRect blurRect(topLeft, minInsetBlur->GetSize()); aExtendDestBy = blurRect - outerRect; - aSlice += aExtendDestBy; - aSlice += aExtendDestBy; - CacheInsetBlur(outerRect.Size(), innerRect.Size(), + if (useDestRect) { + // Since we're just going to paint the actual rect to the destination + aSlice.SizeTo(0, 0, 0, 0); + } else { + aSlice += aExtendDestBy; + aSlice += aExtendDestBy; + + CacheInsetBlur(outerRect.Size(), innerRect.Size(), aBlurRadius, aSpreadRadius, &aInnerClipRadii, aShadowColor, aHasBorderRadius, destDrawTarget->GetBackendType(), aExtendDestBy, minInsetBlur); + + } + return minInsetBlur.forget(); } @@ -1027,11 +1050,13 @@ gfxAlphaBoxBlur::BlurInsetBox(gfxContext* aDestinationCtx, IntMargin extendDest; IntMargin slice; + bool didMoveOffset; RefPtr minInsetBlur = GetInsetBlur(extendDest, slice, aDestinationRect, aShadowClipRect, aBlurRadius, aSpreadRadius, aInnerClipRadii, aShadowColor, - aHasBorderRadius, aDestinationCtx); + aHasBorderRadius, aShadowOffset, + didMoveOffset, aDestinationCtx); if (!minInsetBlur) { return; } @@ -1041,13 +1066,15 @@ gfxAlphaBoxBlur::BlurInsetBox(gfxContext* aDestinationCtx, srcInner.Deflate(Margin(slice)); Rect dstOuter(aDestinationRect); - dstOuter.MoveBy(aShadowOffset); + if (!didMoveOffset) { + dstOuter.MoveBy(aShadowOffset); + } dstOuter.Inflate(Margin(extendDest)); Rect dstInner = dstOuter; dstInner.Deflate(Margin(slice)); DrawTarget* destDrawTarget = aDestinationCtx->GetDrawTarget(); - if (srcOuter.IsEqualInterior(srcInner)) { + if (dstOuter.Size() == srcOuter.Size()) { destDrawTarget->DrawSurface(minInsetBlur, dstOuter, srcOuter); } else { DrawBoxShadows(*destDrawTarget, minInsetBlur, diff --git a/gfx/thebes/gfxBlur.h b/gfx/thebes/gfxBlur.h index 1c2dc6bf6b..27c293b446 100644 --- a/gfx/thebes/gfxBlur.h +++ b/gfx/thebes/gfxBlur.h @@ -174,6 +174,8 @@ protected: const RectCornerRadii& aInnerClipRadii, const mozilla::gfx::Color& aShadowColor, const bool& aHasBorderRadius, + const mozilla::gfx::Point aShadowOffset, + bool& aMovedOffset, gfxContext* aDestinationCtx); /** diff --git a/intl/unicharutil/tools/genUnicodePropertyData.pl b/intl/unicharutil/tools/genUnicodePropertyData.pl index c6a799c730..41ee4358e6 100644 --- a/intl/unicharutil/tools/genUnicodePropertyData.pl +++ b/intl/unicharutil/tools/genUnicodePropertyData.pl @@ -19,6 +19,7 @@ # - UnicodeData.txt # - Scripts.txt # - BidiMirroring.txt +# - BidiBrackets.txt # - HangulSyllableType.txt # - ReadMe.txt (to record version/date of the UCD) # - Unihan_Variants.txt (from Unihan.zip) @@ -334,6 +335,7 @@ my @script; my @category; my @combining; my @mirror; +my @pairedBracketType; my @hangul; my @casemap; my @xidmod; @@ -346,6 +348,7 @@ for (my $i = 0; $i < 0x110000; ++$i) { $script[$i] = $scriptCode{"UNKNOWN"}; $category[$i] = $catCode{"UNASSIGNED"}; $combining[$i] = 0; + $pairedBracketType[$i] = 0; $casemap[$i] = 0; $xidmod[$i] = $xidmodCode{"not-chars"}; $numericvalue[$i] = -1; @@ -523,13 +526,38 @@ while () { s/#.*//; if (m/([0-9A-F]{4,6});\s*([0-9A-F]{4,6})/) { my $mirrorOffset = hex("0x$2") - hex("0x$1"); - my $offsetIndex = first { $offsets[$_] eq $mirrorOffset } 0..$#offsets; - if ($offsetIndex == undef) { + my $offsetIndex = first { $offsets[$_] eq $mirrorOffset } 0..$#offsets; + if ($offsetIndex == undef) { die "too many offset codes\n" if scalar @offsets == 31; push @offsets, $mirrorOffset; - $offsetIndex = $#offsets; + $offsetIndex = $#offsets; } - $mirror[hex "0x$1"] = $offsetIndex; + $mirror[hex "0x$1"] = $offsetIndex; + } +} +close FH; + +# read BidiBrackets.txt +my %pairedBracketTypeCode = ( + 'N' => 0, + 'O' => 1, + 'C' => 2 +); +open FH, "< $ARGV[1]/BidiBrackets.txt" or die "can't open UCD file BidiBrackets.txt\n"; +push @versionInfo, ""; +while () { + chomp; + push @versionInfo, $_; + last if /Date:/; +} +while () { + s/#.*//; + if (m/([0-9A-F]{4,6});\s*([0-9A-F]{4,6});\s*(.)/) { + my $mirroredChar = $offsets[$mirror[hex "0x$1"]] + hex "0x$1"; + die "bidi bracket does not match mirrored char\n" unless $mirroredChar == hex "0x$2"; + my $pbt = uc($3); + warn "unknown Bidi Bracket type" unless exists $pairedBracketTypeCode{$pbt}; + $pairedBracketType[hex "0x$1"] = $pairedBracketTypeCode{$pbt}; } } close FH; @@ -736,27 +764,27 @@ struct nsCharProps1 { /; print DATA_TABLES "#ifndef ENABLE_INTL_API\n"; &genTables("CharProp1", $type, "nsCharProps1", 11, 5, \&sprintCharProps1, 1, 2, 1); -+print DATA_TABLES "#endif\n\n"; +print DATA_TABLES "#endif\n\n"; sub sprintCharProps2 { my $usv = shift; return sprintf("{%d,%d,%d,%d,%d,%d,%d},", - $script[$usv], 0, $category[$usv], + $script[$usv], $pairedBracketType[$usv], $category[$usv], $bidicategory[$usv], $xidmod[$usv], $numericvalue[$usv], $verticalOrientation[$usv]); } -$type = q/ +$type = q| struct nsCharProps2 { unsigned char mScriptCode:8; - unsigned char mUnused:3; + unsigned char mPairedBracketType:3; // only 2 bits actually needed unsigned char mCategory:5; unsigned char mBidiCategory:5; unsigned char mXidmod:4; signed char mNumericValue:5; unsigned char mVertOrient:2; }; -/; +|; &genTables("CharProp2", $type, "nsCharProps2", 11, 5, \&sprintCharProps2, 16, 4, 1); print HEADER "#pragma pack()\n\n"; diff --git a/intl/unicharutil/util/nsUnicodeProperties.cpp b/intl/unicharutil/util/nsUnicodeProperties.cpp index bd258d2fcd..22810e5f84 100644 --- a/intl/unicharutil/util/nsUnicodeProperties.cpp +++ b/intl/unicharutil/util/nsUnicodeProperties.cpp @@ -170,6 +170,26 @@ GetScriptTagForCode(int32_t aScriptCode) return sScriptCodeToTag[aScriptCode]; } +PairedBracketType GetPairedBracketType(uint32_t aCh) +{ +#if ENABLE_INTL_API + return PairedBracketType + (u_getIntPropertyValue(aCh, UCHAR_BIDI_PAIRED_BRACKET_TYPE)); +#else + return PairedBracketType(GetCharProps2(aCh).mPairedBracketType); +#endif +} + +uint32_t GetPairedBracket(uint32_t aCh) +{ +#if ENABLE_INTL_API + return u_getBidiPairedBracket(aCh); +#else + return GetPairedBracketType(aCh) != PAIRED_BRACKET_TYPE_NONE + ? GetMirroredChar(aCh) : aCh; +#endif +} + static inline uint32_t GetCaseMapValue(uint32_t aCh) { diff --git a/intl/unicharutil/util/nsUnicodeProperties.h b/intl/unicharutil/util/nsUnicodeProperties.h index 71a23cf598..3abf660b0d 100644 --- a/intl/unicharutil/util/nsUnicodeProperties.h +++ b/intl/unicharutil/util/nsUnicodeProperties.h @@ -57,6 +57,16 @@ inline VerticalOrientation GetVerticalOrientation(uint32_t aCh) { return VerticalOrientation(GetCharProps2(aCh).mVertOrient); } +/* This MUST match the values assigned by genUnicodePropertyData.pl! */ +enum PairedBracketType { + PAIRED_BRACKET_TYPE_NONE = 0, + PAIRED_BRACKET_TYPE_OPEN = 1, + PAIRED_BRACKET_TYPE_CLOSE = 2 +}; + +PairedBracketType GetPairedBracketType(uint32_t aCh); +uint32_t GetPairedBracket(uint32_t aCh); + enum XidmodType { XIDMOD_RECOMMENDED, XIDMOD_INCLUSION, diff --git a/intl/unicharutil/util/nsUnicodePropertyData.cpp b/intl/unicharutil/util/nsUnicodePropertyData.cpp index 9a0be8583c..0f0b85c1bf 100644 --- a/intl/unicharutil/util/nsUnicodePropertyData.cpp +++ b/intl/unicharutil/util/nsUnicodePropertyData.cpp @@ -11,7 +11,7 @@ */ /* - * Created on Mon Sep 7 02:52:23 2015 from UCD data files with version info: + * Created on Tue Nov 17 07:34:16 2015 from UCD data files with version info: * # Date: 2015-06-16, 20:24:00 GMT [KW] @@ -38,6 +38,9 @@ Standard. # BidiMirroring-8.0.0.txt # Date: 2015-01-20, 18:30:00 GMT [KW, LI] +# BidiBrackets-8.0.0.txt +# Date: 2015-01-20, 19:00:00 GMT [AG, LI, KW] + # HangulSyllableType-8.0.0.txt # Date: 2014-12-16, 23:07:45 GMT [MD] @@ -411,9 +414,9 @@ static const uint16_t sCharProp2Pages[7][2048] = { static const nsCharProps2 sCharProp2Values[646][32] = { {{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,8,8,-1,1},{0,0,0,7,8,-1,1},{0,0,0,8,8,-1,1},{0,0,0,9,8,-1,1},{0,0,0,7,8,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,7,12,-1,1},{0,0,0,7,12,-1,1},{0,0,0,7,12,-1,1},{0,0,0,8,12,-1,1}}, - {{0,0,29,9,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,21,4,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,1,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,25,3,8,-1,1},{0,0,21,6,8,-1,1},{0,0,17,3,1,-1,1},{0,0,21,6,1,-1,1},{0,0,21,6,8,-1,1},{0,0,13,2,0,0,1},{0,0,13,2,0,1,1},{0,0,13,2,0,2,1},{0,0,13,2,0,3,1},{0,0,13,2,0,4,1},{0,0,13,2,0,5,1},{0,0,13,2,0,6,1},{0,0,13,2,0,7,1},{0,0,13,2,0,8,1},{0,0,13,2,0,9,1},{0,0,21,6,1,-1,1},{0,0,21,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,21,10,8,-1,1}}, - {{0,0,21,10,8,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{0,0,22,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,24,10,8,-1,1},{0,0,16,10,0,-1,1}}, - {{0,0,24,10,8,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{0,0,22,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,0,18,12,-1,1}}, + {{0,0,29,9,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,21,4,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,1,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,25,3,8,-1,1},{0,0,21,6,8,-1,1},{0,0,17,3,1,-1,1},{0,0,21,6,1,-1,1},{0,0,21,6,8,-1,1},{0,0,13,2,0,0,1},{0,0,13,2,0,1,1},{0,0,13,2,0,2,1},{0,0,13,2,0,3,1},{0,0,13,2,0,4,1},{0,0,13,2,0,5,1},{0,0,13,2,0,6,1},{0,0,13,2,0,7,1},{0,0,13,2,0,8,1},{0,0,13,2,0,9,1},{0,0,21,6,1,-1,1},{0,0,21,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,21,10,8,-1,1}}, + {{0,0,21,10,8,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{0,1,22,10,8,-1,1},{0,0,21,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,24,10,8,-1,1},{0,0,16,10,0,-1,1}}, + {{0,0,24,10,8,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{25,0,5,0,0,-1,1},{0,1,22,10,8,-1,1},{0,0,25,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,0,18,12,-1,1}}, {{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,7,8,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1},{0,0,0,18,12,-1,1}}, {{0,0,29,6,9,-1,1},{0,0,21,10,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,26,10,8,-1,1},{0,0,21,10,8,-1,0},{0,0,24,10,9,-1,1},{0,0,26,10,8,-1,0},{25,0,7,0,9,-1,1},{0,0,20,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,1,18,10,-1,1},{0,0,26,10,8,-1,0},{0,0,24,10,9,-1,1},{0,0,26,4,8,-1,1},{0,0,25,4,8,-1,0},{0,0,15,2,9,2,1},{0,0,15,2,9,3,1},{0,0,24,10,9,-1,1},{0,0,5,0,9,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,1,-1,1},{0,0,24,10,9,-1,1},{0,0,15,2,9,1,1},{25,0,7,0,9,-1,1},{0,0,19,10,8,-1,1},{0,0,15,10,9,-1,0},{0,0,15,10,9,-1,0},{0,0,15,10,9,-1,0},{0,0,21,10,8,-1,1}}, {{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{0,0,25,10,8,-1,0},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,9,0,0,-1,1},{25,0,5,0,0,-1,1}}, @@ -525,7 +528,7 @@ static const nsCharProps2 sCharProp2Values[646][32] = { {{61,0,2,0,12,-1,1},{24,0,7,0,0,-1,1},{24,0,7,0,0,-1,1},{24,0,7,0,0,-1,1},{61,0,2,0,12,-1,1},{24,0,7,0,0,-1,1},{61,0,2,0,12,-1,1},{24,0,7,0,0,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{24,0,7,0,0,-1,1},{24,0,7,0,0,-1,1},{61,0,2,0,12,-1,1},{24,0,7,0,0,-1,1},{24,0,7,0,0,-1,1},{24,0,7,0,0,-1,1},{24,0,7,0,0,-1,1},{24,0,12,17,0,-1,1},{24,0,7,0,0,-1,1},{24,0,7,0,9,-1,1},{24,0,12,17,0,-1,1},{24,0,12,17,0,-1,1},{24,0,12,17,0,-1,1},{24,0,12,17,0,-1,1},{24,0,12,17,0,-1,1},{24,0,12,17,0,-1,1},{61,0,2,0,12,-1,1},{24,0,12,17,0,-1,1},{24,0,12,17,0,-1,1},{24,0,7,0,0,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1}}, {{24,0,7,0,0,-1,1},{24,0,7,0,0,-1,1},{24,0,7,0,0,-1,1},{24,0,7,0,0,-1,1},{24,0,7,0,0,-1,1},{61,0,2,0,12,-1,1},{24,0,6,0,0,-1,1},{61,0,2,0,12,-1,1},{24,0,12,17,0,-1,1},{24,0,12,17,0,-1,1},{24,0,12,17,0,-1,1},{24,0,12,17,0,-1,1},{24,0,12,17,0,-1,1},{24,0,12,17,0,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{24,0,13,0,0,0,1},{24,0,13,0,0,1,1},{24,0,13,0,0,2,1},{24,0,13,0,0,3,1},{24,0,13,0,0,4,1},{24,0,13,0,0,5,1},{24,0,13,0,0,6,1},{24,0,13,0,0,7,1},{24,0,13,0,0,8,1},{24,0,13,0,0,9,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{24,0,7,0,9,-1,1},{24,0,7,0,9,-1,1},{24,0,7,0,0,-1,1},{24,0,7,0,0,-1,1}}, {{39,0,7,0,0,-1,1},{39,0,26,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,1,-1,1},{39,0,21,0,9,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,21,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,12,17,3,-1,1},{39,0,12,17,3,-1,1},{39,0,26,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,26,0,8,-1,1}}, - {{39,0,13,0,0,0,1},{39,0,13,0,0,1,1},{39,0,13,0,0,2,1},{39,0,13,0,0,3,1},{39,0,13,0,0,4,1},{39,0,13,0,0,5,1},{39,0,13,0,0,6,1},{39,0,13,0,0,7,1},{39,0,13,0,0,8,1},{39,0,13,0,0,9,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,12,17,0,-1,1},{39,0,26,0,8,-1,1},{39,0,12,17,0,-1,1},{39,0,26,0,8,-1,1},{39,0,12,17,2,-1,1},{39,0,22,10,8,-1,1},{39,0,18,10,8,-1,1},{39,0,22,10,8,-1,1},{39,0,18,10,8,-1,1},{39,0,10,0,0,-1,1},{39,0,10,0,0,-1,1}}, + {{39,0,13,0,0,0,1},{39,0,13,0,0,1,1},{39,0,13,0,0,2,1},{39,0,13,0,0,3,1},{39,0,13,0,0,4,1},{39,0,13,0,0,5,1},{39,0,13,0,0,6,1},{39,0,13,0,0,7,1},{39,0,13,0,0,8,1},{39,0,13,0,0,9,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,15,0,8,-1,1},{39,0,26,0,8,-1,1},{39,0,12,17,0,-1,1},{39,0,26,0,8,-1,1},{39,0,12,17,0,-1,1},{39,0,26,0,8,-1,1},{39,0,12,17,2,-1,1},{39,1,22,10,8,-1,1},{39,2,18,10,8,-1,1},{39,1,22,10,8,-1,1},{39,2,18,10,8,-1,1},{39,0,10,0,0,-1,1},{39,0,10,0,0,-1,1}}, {{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,9,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{61,0,2,0,12,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,9,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,9,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,9,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,9,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1}}, {{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,9,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,9,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,9,-1,1},{39,0,12,17,9,-1,1},{39,0,12,17,11,-1,1},{39,0,12,17,9,-1,1},{39,0,12,17,11,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,10,0,0,-1,1}}, {{39,0,12,17,0,-1,1},{39,0,12,17,9,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,21,0,8,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,7,0,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,9,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{61,0,2,0,12,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,9,-1,1},{39,0,12,17,0,-1,1},{39,0,12,17,0,-1,1}}, @@ -556,7 +559,7 @@ static const nsCharProps2 sCharProp2Values[646][32] = { {{40,0,17,10,8,-1,1},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0}}, {{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0}}, {{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,21,0,8,-1,0},{40,0,21,0,8,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0},{40,0,7,0,5,-1,0}}, - {{29,0,29,9,8,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,22,10,8,-1,1},{29,0,18,10,8,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1}}, + {{29,0,29,9,8,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,0,7,0,7,-1,1},{29,1,22,10,8,-1,1},{29,2,18,10,8,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1}}, {{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1}}, {{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{0,0,21,0,8,-1,1},{0,0,21,0,8,-1,1},{0,0,21,0,8,-1,1},{32,0,14,0,7,-1,1},{32,0,14,0,7,-1,1},{32,0,14,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{32,0,7,0,7,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1}}, {{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{61,0,2,0,12,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,7,0,7,-1,1},{42,0,12,17,7,-1,1},{42,0,12,17,7,-1,1},{42,0,12,17,7,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1}}, @@ -621,9 +624,9 @@ static const nsCharProps2 sCharProp2Values[646][32] = { {{14,0,5,0,0,-1,1},{14,0,5,0,0,-1,1},{14,0,5,0,0,-1,1},{14,0,5,0,9,-1,1},{14,0,5,0,0,-1,1},{14,0,5,0,0,-1,1},{14,0,5,0,0,-1,1},{14,0,5,0,0,-1,1},{14,0,9,0,0,-1,1},{14,0,9,0,0,-1,1},{14,0,9,0,0,-1,1},{14,0,9,0,9,-1,1},{14,0,9,0,0,-1,1},{14,0,24,10,9,-1,1},{14,0,24,10,9,-1,1},{14,0,24,10,9,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{14,0,5,0,0,-1,1},{14,0,5,0,0,-1,1},{14,0,5,0,0,-1,1},{61,0,2,0,12,-1,1},{14,0,5,0,0,-1,1},{14,0,5,0,0,-1,1},{14,0,9,0,0,-1,1},{14,0,9,0,9,-1,1},{14,0,9,0,0,-1,1},{14,0,9,0,9,-1,1},{14,0,8,0,0,-1,1},{14,0,24,10,9,-1,1},{14,0,24,10,9,-1,1},{61,0,2,0,12,-1,1}}, {{0,0,29,9,9,-1,1},{0,0,29,9,9,-1,1},{0,0,29,9,9,-1,1},{0,0,29,9,9,-1,1},{0,0,29,9,9,-1,1},{0,0,29,9,9,-1,1},{0,0,29,9,9,-1,1},{0,0,29,9,9,-1,1},{0,0,29,9,9,-1,1},{0,0,29,9,9,-1,1},{0,0,29,9,9,-1,1},{0,0,1,18,10,-1,1},{1,0,1,18,1,-1,1},{1,0,1,18,1,-1,1},{0,0,1,0,10,-1,1},{0,0,1,1,10,-1,1},{0,0,17,10,1,-1,1},{0,0,17,10,9,-1,1},{0,0,17,10,8,-1,1},{0,0,17,10,8,-1,1},{0,0,17,10,8,-1,1},{0,0,17,10,8,-1,1},{0,0,21,10,8,-1,0},{0,0,21,10,9,-1,1},{0,0,20,10,8,-1,1},{0,0,19,10,1,-1,1},{0,0,22,10,8,-1,1},{0,0,20,10,8,-1,1},{0,0,20,10,8,-1,1},{0,0,19,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,20,10,8,-1,1}}, {{0,0,21,10,8,-1,0},{0,0,21,10,8,-1,0},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,1,-1,1},{0,0,27,9,8,-1,1},{0,0,28,7,8,-1,1},{0,0,1,11,10,-1,1},{0,0,1,14,10,-1,1},{0,0,1,16,10,-1,1},{0,0,1,12,10,-1,1},{0,0,1,15,10,-1,1},{0,0,29,6,9,-1,1},{0,0,21,4,8,-1,0},{0,0,21,4,8,-1,0},{0,0,21,4,8,-1,1},{0,0,21,4,9,-1,1},{0,0,21,4,9,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,8,-1,1},{0,0,20,10,8,-1,1},{0,0,19,10,8,-1,1},{0,0,21,10,8,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,8,-1,1},{0,0,21,10,9,-1,1},{0,0,16,10,3,-1,1}}, - {{0,0,16,10,3,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,0},{0,0,21,10,8,-1,1},{0,0,25,6,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,0},{0,0,25,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,16,10,2,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,29,9,9,-1,1}}, - {{0,0,1,18,10,-1,1},{0,0,1,18,10,-1,1},{0,0,1,18,10,-1,1},{0,0,1,18,10,-1,1},{0,0,1,18,10,-1,1},{61,0,2,0,12,-1,0},{0,0,1,19,10,-1,1},{0,0,1,20,10,-1,1},{0,0,1,21,10,-1,1},{0,0,1,22,10,-1,1},{0,0,1,18,11,-1,1},{0,0,1,18,11,-1,1},{0,0,1,18,11,-1,1},{0,0,1,18,11,-1,1},{0,0,1,18,11,-1,1},{0,0,1,18,11,-1,1},{0,0,15,2,9,0,1},{25,0,6,0,9,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{0,0,15,2,9,4,1},{0,0,15,2,9,5,1},{0,0,15,2,9,6,1},{0,0,15,2,9,7,1},{0,0,15,2,9,8,1},{0,0,15,2,9,9,1},{0,0,25,3,9,-1,1},{0,0,25,3,9,-1,1},{0,0,25,10,9,-1,1},{0,0,22,10,9,-1,1},{0,0,18,10,9,-1,1},{25,0,6,0,9,-1,1}}, - {{0,0,15,2,9,0,1},{0,0,15,2,9,1,1},{0,0,15,2,9,2,1},{0,0,15,2,9,3,1},{0,0,15,2,9,4,1},{0,0,15,2,9,5,1},{0,0,15,2,9,6,1},{0,0,15,2,9,7,1},{0,0,15,2,9,8,1},{0,0,15,2,9,9,1},{0,0,25,3,9,-1,1},{0,0,25,3,9,-1,1},{0,0,25,10,9,-1,1},{0,0,22,10,9,-1,1},{0,0,18,10,9,-1,1},{61,0,2,0,12,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1}}, + {{0,0,16,10,3,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,0},{0,0,21,10,8,-1,1},{0,0,25,6,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,0},{0,0,25,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,16,10,2,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,29,9,9,-1,1}}, + {{0,0,1,18,10,-1,1},{0,0,1,18,10,-1,1},{0,0,1,18,10,-1,1},{0,0,1,18,10,-1,1},{0,0,1,18,10,-1,1},{61,0,2,0,12,-1,0},{0,0,1,19,10,-1,1},{0,0,1,20,10,-1,1},{0,0,1,21,10,-1,1},{0,0,1,22,10,-1,1},{0,0,1,18,11,-1,1},{0,0,1,18,11,-1,1},{0,0,1,18,11,-1,1},{0,0,1,18,11,-1,1},{0,0,1,18,11,-1,1},{0,0,1,18,11,-1,1},{0,0,15,2,9,0,1},{25,0,6,0,9,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{0,0,15,2,9,4,1},{0,0,15,2,9,5,1},{0,0,15,2,9,6,1},{0,0,15,2,9,7,1},{0,0,15,2,9,8,1},{0,0,15,2,9,9,1},{0,0,25,3,9,-1,1},{0,0,25,3,9,-1,1},{0,0,25,10,9,-1,1},{0,1,22,10,9,-1,1},{0,2,18,10,9,-1,1},{25,0,6,0,9,-1,1}}, + {{0,0,15,2,9,0,1},{0,0,15,2,9,1,1},{0,0,15,2,9,2,1},{0,0,15,2,9,3,1},{0,0,15,2,9,4,1},{0,0,15,2,9,5,1},{0,0,15,2,9,6,1},{0,0,15,2,9,7,1},{0,0,15,2,9,8,1},{0,0,15,2,9,9,1},{0,0,25,3,9,-1,1},{0,0,25,3,9,-1,1},{0,0,25,10,9,-1,1},{0,1,22,10,9,-1,1},{0,2,18,10,9,-1,1},{61,0,2,0,12,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{25,0,6,0,9,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1}}, {{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,9,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{0,0,23,4,8,-1,1},{61,0,2,4,12,-1,1}}, {{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{61,0,2,4,12,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,11,17,8,-1,0},{1,0,11,17,8,-1,0},{1,0,11,17,8,-1,0}}, {{1,0,11,17,8,-1,0},{1,0,12,17,7,-1,1},{1,0,11,17,8,-1,0},{1,0,11,17,8,-1,0},{1,0,11,17,8,-1,0},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{1,0,12,17,7,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1}}, @@ -638,8 +641,8 @@ static const nsCharProps2 sCharProp2Values[646][32] = { {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,3,8,-1,1},{0,0,25,4,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,0},{0,0,25,10,8,-1,1}}, {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,0},{0,0,25,10,8,-1,0},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, - {{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0}}, - {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,22,10,11,-1,3},{0,0,18,10,11,-1,3},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1}}, + {{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0}}, + {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,1,22,10,11,-1,3},{0,2,18,10,11,-1,3},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1}}, {{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1}}, {{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,0,8,-1,1},{0,0,26,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0}}, {{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,0,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, @@ -660,14 +663,14 @@ static const nsCharProps2 sCharProp2Values[646][32] = { {{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1}}, {{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,25,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0}}, {{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,0,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0}}, - {{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,15,10,8,1,0},{0,0,15,10,8,2,0},{0,0,15,10,8,3,0},{0,0,15,10,8,4,0},{0,0,15,10,8,5,0},{0,0,15,10,8,6,0},{0,0,15,10,8,7,0},{0,0,15,10,8,8,0},{0,0,15,10,8,9,0},{0,0,15,10,8,-1,0}}, + {{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,15,10,8,1,0},{0,0,15,10,8,2,0},{0,0,15,10,8,3,0},{0,0,15,10,8,4,0},{0,0,15,10,8,5,0},{0,0,15,10,8,6,0},{0,0,15,10,8,7,0},{0,0,15,10,8,8,0},{0,0,15,10,8,9,0},{0,0,15,10,8,-1,0}}, {{0,0,15,10,8,1,0},{0,0,15,10,8,2,0},{0,0,15,10,8,3,0},{0,0,15,10,8,4,0},{0,0,15,10,8,5,0},{0,0,15,10,8,6,0},{0,0,15,10,8,7,0},{0,0,15,10,8,8,0},{0,0,15,10,8,9,0},{0,0,15,10,8,-1,0},{0,0,15,10,8,1,0},{0,0,15,10,8,2,0},{0,0,15,10,8,3,0},{0,0,15,10,8,4,0},{0,0,15,10,8,5,0},{0,0,15,10,8,6,0},{0,0,15,10,8,7,0},{0,0,15,10,8,8,0},{0,0,15,10,8,9,0},{0,0,15,10,8,-1,0},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1},{0,0,26,10,8,-1,1}}, - {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, - {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, + {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, + {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, {{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1},{46,0,26,0,8,-1,1}}, - {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, - {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, - {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, + {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, + {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, + {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, {{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1},{0,0,25,10,8,-1,1}}, @@ -693,7 +696,7 @@ static const nsCharProps2 sCharProp2Values[646][32] = { {{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{61,0,2,0,12,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{61,0,2,0,12,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{61,0,2,0,12,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{11,0,7,0,0,-1,1},{61,0,2,0,12,-1,1}}, {{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1},{8,0,12,17,4,-1,1}}, {{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,20,10,8,-1,1},{0,0,19,10,8,-1,1},{0,0,20,10,8,-1,1},{0,0,19,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,20,10,8,-1,1},{0,0,19,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,20,10,8,-1,1},{0,0,19,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,17,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,17,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,20,10,8,-1,1},{0,0,19,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1}}, - {{0,0,20,10,8,-1,1},{0,0,19,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,22,10,8,-1,1},{0,0,18,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,6,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,17,10,8,-1,1},{0,0,17,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1}}, + {{0,0,20,10,8,-1,1},{0,0,19,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,1,22,10,8,-1,1},{0,2,18,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,6,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,17,10,8,-1,1},{0,0,17,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,21,10,8,-1,1}}, {{0,0,17,10,8,-1,1},{0,0,21,10,8,-1,1},{0,0,22,10,8,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1}}, {{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{61,0,2,0,12,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,9,-1,0}}, {{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0},{17,0,26,10,8,-1,0}}, @@ -701,7 +704,7 @@ static const nsCharProps2 sCharProp2Values[646][32] = { {{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0}}, {{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{17,0,26,10,9,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0}}, {{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0}}, - {{0,0,29,9,9,-1,0},{0,0,21,10,8,-1,2},{0,0,21,10,8,-1,2},{0,0,21,10,8,-1,0},{0,0,26,10,8,-1,0},{17,0,6,0,0,-1,0},{0,0,7,0,0,-1,0},{17,0,14,0,0,-1,0},{0,0,22,10,8,-1,3},{0,0,18,10,8,-1,3},{0,0,22,10,8,-1,3},{0,0,18,10,8,-1,3},{0,0,22,10,8,-1,3},{0,0,18,10,8,-1,3},{0,0,22,10,8,-1,3},{0,0,18,10,8,-1,3},{0,0,22,10,8,-1,3},{0,0,18,10,8,-1,3},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,22,10,8,-1,3},{0,0,18,10,8,-1,3},{0,0,22,10,8,-1,3},{0,0,18,10,8,-1,3},{0,0,22,10,8,-1,3},{0,0,18,10,8,-1,3},{0,0,22,10,8,-1,3},{0,0,18,10,8,-1,3},{0,0,17,10,8,-1,3},{0,0,22,10,8,-1,3},{0,0,18,10,8,-1,3},{0,0,18,10,8,-1,3}}, + {{0,0,29,9,9,-1,0},{0,0,21,10,8,-1,2},{0,0,21,10,8,-1,2},{0,0,21,10,8,-1,0},{0,0,26,10,8,-1,0},{17,0,6,0,0,-1,0},{0,0,7,0,0,-1,0},{17,0,14,0,0,-1,0},{0,1,22,10,8,-1,3},{0,2,18,10,8,-1,3},{0,1,22,10,8,-1,3},{0,2,18,10,8,-1,3},{0,1,22,10,8,-1,3},{0,2,18,10,8,-1,3},{0,1,22,10,8,-1,3},{0,2,18,10,8,-1,3},{0,1,22,10,8,-1,3},{0,2,18,10,8,-1,3},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0},{0,1,22,10,8,-1,3},{0,2,18,10,8,-1,3},{0,1,22,10,8,-1,3},{0,2,18,10,8,-1,3},{0,1,22,10,8,-1,3},{0,2,18,10,8,-1,3},{0,1,22,10,8,-1,3},{0,2,18,10,8,-1,3},{0,0,17,10,8,-1,3},{0,0,22,10,8,-1,3},{0,0,18,10,8,-1,3},{0,0,18,10,8,-1,3}}, {{0,0,26,10,8,-1,0},{17,0,14,0,3,-1,0},{17,0,14,0,3,-1,0},{17,0,14,0,3,-1,0},{17,0,14,0,3,-1,0},{17,0,14,0,3,-1,0},{17,0,14,0,3,-1,0},{17,0,14,0,3,-1,0},{17,0,14,0,3,-1,0},{17,0,14,0,3,-1,0},{1,0,12,17,3,-1,0},{1,0,12,17,3,-1,0},{1,0,12,17,3,-1,0},{1,0,12,17,3,-1,0},{18,0,10,0,4,-1,0},{18,0,10,0,4,-1,0},{0,0,17,10,8,-1,3},{0,0,6,0,3,-1,0},{0,0,6,0,3,-1,0},{0,0,6,0,3,-1,0},{0,0,6,0,3,-1,0},{0,0,6,0,3,-1,0},{0,0,26,10,9,-1,0},{0,0,26,10,8,-1,0},{17,0,14,0,9,-1,0},{17,0,14,0,9,-1,0},{17,0,14,0,9,-1,0},{17,0,6,0,3,-1,0},{0,0,7,0,3,-1,0},{0,0,21,10,8,-1,0},{0,0,26,10,8,-1,0},{0,0,26,10,8,-1,0}}, {{61,0,2,0,12,-1,0},{20,0,7,0,0,-1,2},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,2},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,2},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,2},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,2},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0}}, {{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,2},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0},{20,0,7,0,0,-1,0}}, @@ -806,13 +809,13 @@ static const nsCharProps2 sCharProp2Values[646][32] = { {{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,23,13,9,-1,1},{2,0,26,10,8,-1,1},{61,0,2,13,12,-1,1},{61,0,2,13,12,-1,1}}, {{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{1,0,12,17,10,-1,1},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,21,10,9,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0}}, {{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{1,0,12,17,3,-1,1},{8,0,12,17,3,-1,1},{8,0,12,17,3,-1,1},{0,0,21,10,9,-1,0},{0,0,17,10,9,-1,0},{0,0,17,10,9,-1,0},{0,0,16,10,9,-1,0},{0,0,16,10,9,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,22,10,9,-1,0}}, - {{0,0,18,10,9,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,21,10,8,-1,0},{0,0,21,10,8,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,21,10,9,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,9,-1,1},{0,0,16,10,9,-1,1},{0,0,16,10,9,-1,1},{0,0,16,10,9,-1,1},{0,0,21,6,9,-1,2},{0,0,21,10,9,-1,2},{0,0,21,6,9,-1,2},{61,0,2,0,12,-1,0},{0,0,21,10,9,-1,0},{0,0,21,6,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,17,10,9,-1,1},{0,0,22,10,9,-1,3},{0,0,18,10,9,-1,3},{0,0,22,10,9,-1,3},{0,0,18,10,9,-1,3},{0,0,22,10,9,-1,3},{0,0,18,10,9,-1,3},{0,0,21,4,9,-1,0}}, + {{0,0,18,10,9,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,21,10,8,-1,0},{0,0,21,10,8,-1,0},{0,0,22,10,9,-1,0},{0,0,18,10,9,-1,0},{0,0,21,10,9,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,9,-1,1},{0,0,16,10,9,-1,1},{0,0,16,10,9,-1,1},{0,0,16,10,9,-1,1},{0,0,21,6,9,-1,2},{0,0,21,10,9,-1,2},{0,0,21,6,9,-1,2},{61,0,2,0,12,-1,0},{0,0,21,10,9,-1,0},{0,0,21,6,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,17,10,9,-1,1},{0,1,22,10,9,-1,3},{0,2,18,10,9,-1,3},{0,1,22,10,9,-1,3},{0,2,18,10,9,-1,3},{0,1,22,10,9,-1,3},{0,2,18,10,9,-1,3},{0,0,21,4,9,-1,0}}, {{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,25,3,9,-1,0},{0,0,17,3,9,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,9,-1,1},{61,0,2,0,12,-1,0},{0,0,21,10,9,-1,0},{0,0,23,4,9,-1,0},{0,0,21,4,9,-1,0},{0,0,21,10,9,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{61,0,2,0,12,-1,0},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,3,-1,1},{2,0,7,13,9,-1,1},{61,0,2,13,12,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1}}, {{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{2,0,7,13,9,-1,1},{61,0,2,13,12,-1,1},{61,0,2,13,12,-1,1},{0,0,1,18,10,-1,1}}, - {{61,0,2,0,12,-1,1},{0,0,21,10,9,-1,2},{0,0,21,10,9,-1,0},{0,0,21,4,9,-1,0},{0,0,23,4,9,-1,0},{0,0,21,4,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,0,22,10,9,-1,3},{0,0,18,10,9,-1,3},{0,0,21,10,9,-1,0},{0,0,25,3,9,-1,0},{0,0,21,6,9,-1,2},{0,0,17,3,9,-1,1},{0,0,21,6,9,-1,2},{0,0,21,6,9,-1,0},{0,0,13,2,9,0,0},{0,0,13,2,9,1,0},{0,0,13,2,9,2,0},{0,0,13,2,9,3,0},{0,0,13,2,9,4,0},{0,0,13,2,9,5,0},{0,0,13,2,9,6,0},{0,0,13,2,9,7,0},{0,0,13,2,9,8,0},{0,0,13,2,9,9,0},{0,0,21,6,9,-1,3},{0,0,21,10,9,-1,3},{0,0,25,10,9,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,9,-1,1},{0,0,21,10,9,-1,2}}, - {{0,0,21,10,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{0,0,22,10,9,-1,3},{0,0,21,10,9,-1,0},{0,0,18,10,9,-1,3},{0,0,24,10,9,-1,0},{0,0,16,10,9,-1,3}}, - {{0,0,24,10,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{0,0,22,10,9,-1,3},{0,0,25,10,9,-1,3},{0,0,18,10,9,-1,3},{0,0,25,10,9,-1,3},{0,0,22,10,9,-1,3}}, - {{0,0,18,10,9,-1,3},{0,0,21,10,9,-1,1},{0,0,22,10,9,-1,1},{0,0,18,10,9,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{0,0,6,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1}}, + {{61,0,2,0,12,-1,1},{0,0,21,10,9,-1,2},{0,0,21,10,9,-1,0},{0,0,21,4,9,-1,0},{0,0,23,4,9,-1,0},{0,0,21,4,9,-1,0},{0,0,21,10,9,-1,0},{0,0,21,10,9,-1,0},{0,1,22,10,9,-1,3},{0,2,18,10,9,-1,3},{0,0,21,10,9,-1,0},{0,0,25,3,9,-1,0},{0,0,21,6,9,-1,2},{0,0,17,3,9,-1,1},{0,0,21,6,9,-1,2},{0,0,21,6,9,-1,0},{0,0,13,2,9,0,0},{0,0,13,2,9,1,0},{0,0,13,2,9,2,0},{0,0,13,2,9,3,0},{0,0,13,2,9,4,0},{0,0,13,2,9,5,0},{0,0,13,2,9,6,0},{0,0,13,2,9,7,0},{0,0,13,2,9,8,0},{0,0,13,2,9,9,0},{0,0,21,6,9,-1,3},{0,0,21,10,9,-1,3},{0,0,25,10,9,-1,1},{0,0,25,10,9,-1,1},{0,0,25,10,9,-1,1},{0,0,21,10,9,-1,2}}, + {{0,0,21,10,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{25,0,9,0,9,-1,0},{0,1,22,10,9,-1,3},{0,0,21,10,9,-1,0},{0,2,18,10,9,-1,3},{0,0,24,10,9,-1,0},{0,0,16,10,9,-1,3}}, + {{0,0,24,10,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{25,0,5,0,9,-1,0},{0,1,22,10,9,-1,3},{0,0,25,10,9,-1,3},{0,2,18,10,9,-1,3},{0,0,25,10,9,-1,3},{0,1,22,10,9,-1,3}}, + {{0,2,18,10,9,-1,3},{0,0,21,10,9,-1,1},{0,1,22,10,9,-1,1},{0,2,18,10,9,-1,1},{0,0,21,10,9,-1,1},{0,0,21,10,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{0,0,6,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1}}, {{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{22,0,7,0,9,-1,1},{0,0,6,0,9,-1,1},{0,0,6,0,9,-1,1}}, {{18,0,7,0,10,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{61,0,2,0,12,-1,1}}, {{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{18,0,7,0,9,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1},{61,0,2,0,12,-1,1}}, diff --git a/intl/unicharutil/util/nsUnicodeScriptCodes.h b/intl/unicharutil/util/nsUnicodeScriptCodes.h index 6edf63c622..18301844d5 100644 --- a/intl/unicharutil/util/nsUnicodeScriptCodes.h +++ b/intl/unicharutil/util/nsUnicodeScriptCodes.h @@ -11,7 +11,7 @@ */ /* - * Created on Thu Sep 3 14:42:28 2015 from UCD data files with version info: + * Created on Tue Nov 17 07:34:16 2015 from UCD data files with version info: * # Date: 2015-06-16, 20:24:00 GMT [KW] @@ -38,6 +38,9 @@ Standard. # BidiMirroring-8.0.0.txt # Date: 2015-01-20, 18:30:00 GMT [KW, LI] +# BidiBrackets-8.0.0.txt +# Date: 2015-01-20, 19:00:00 GMT [AG, LI, KW] + # HangulSyllableType-8.0.0.txt # Date: 2014-12-16, 23:07:45 GMT [MD] @@ -72,7 +75,7 @@ struct nsCharProps1 { struct nsCharProps2 { unsigned char mScriptCode:8; - unsigned char mUnused:3; + unsigned char mPairedBracketType:3; // only 2 bits actually needed unsigned char mCategory:5; unsigned char mBidiCategory:5; unsigned char mXidmod:4; diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list index 3e6375e42d..2dfc874986 100644 --- a/layout/base/crashtests/crashtests.list +++ b/layout/base/crashtests/crashtests.list @@ -462,3 +462,4 @@ load 1116104.html load 1127198-1.html load 1140198.html load 1297835.html +load 1162813.xul diff --git a/layout/base/nsBidi.cpp b/layout/base/nsBidi.cpp index 4de84aa0f3..6a679dc00e 100644 --- a/layout/base/nsBidi.cpp +++ b/layout/base/nsBidi.cpp @@ -41,9 +41,13 @@ enum { RLI = eCharType_RightToLeftIsolate, FSI = eCharType_FirstStrongIsolate, PDI = eCharType_PopDirectionalIsolate, + ENL, /* EN after W7 */ /* 23 */ + ENR, /* EN not subject to W7 */ /* 24 */ dirPropCount }; +#define IS_STRONG_TYPE(dirProp) ((dirProp) <= R || (dirProp) == AL) + /* to avoid some conditional statements, use tiny constant arrays */ static Flags flagLR[2]={ DIRPROP_FLAG(L), DIRPROP_FLAG(R) }; static Flags flagE[2]={ DIRPROP_FLAG(LRE), DIRPROP_FLAG(RLE) }; @@ -53,6 +57,15 @@ static Flags flagO[2]={ DIRPROP_FLAG(LRO), DIRPROP_FLAG(RLO) }; #define DIRPROP_FLAG_E(level) flagE[(level)&1] #define DIRPROP_FLAG_O(level) flagO[(level)&1] +#define NO_OVERRIDE(level) ((level)&~NSBIDI_LEVEL_OVERRIDE) + +static inline uint8_t +DirFromStrong(uint8_t aDirProp) +{ + MOZ_ASSERT(IS_STRONG_TYPE(aDirProp)); + return aDirProp == L ? L : R; +} + /* * General implementation notes: * @@ -138,9 +151,6 @@ static Flags flagO[2]={ DIRPROP_FLAG(LRO), DIRPROP_FLAG(RLO) }; nsBidi::nsBidi() { Init(); - - mMayAllocateText=true; - mMayAllocateRuns=true; } nsBidi::~nsBidi() @@ -174,14 +184,11 @@ void nsBidi::Init() mLevelsMemory=nullptr; mRunsMemory=nullptr; mIsolatesMemory=nullptr; - - mMayAllocateText=false; - mMayAllocateRuns=false; } /* - * We are allowed to allocate memory if aMemory==nullptr or - * aMayAllocate==true for each array that we need. + * We are allowed to allocate memory if aMemory==nullptr + * for each array that we need. * We also try to grow and shrink memory as needed if we * allocate it. * @@ -192,29 +199,24 @@ void nsBidi::Init() * which we know we don't need any more; * is this the best way to do this?? */ -bool nsBidi::GetMemory(void **aMemory, size_t *aSize, bool aMayAllocate, size_t aSizeNeeded) +/*static*/ +bool +nsBidi::GetMemory(void **aMemory, size_t *aSize, size_t aSizeNeeded) { /* check for existing memory */ if(*aMemory==nullptr) { /* we need to allocate memory */ - if(!aMayAllocate) { - return false; + *aMemory=moz_malloc(aSizeNeeded); + if (*aMemory!=nullptr) { + *aSize=aSizeNeeded; + return true; } else { - *aMemory=moz_malloc(aSizeNeeded); - if (*aMemory!=nullptr) { - *aSize=aSizeNeeded; - return true; - } else { - *aSize=0; - return false; - } + *aSize=0; + return false; } } else { /* there is some memory, is it enough or too much? */ - if(aSizeNeeded>*aSize && !aMayAllocate) { - /* not enough memory, and we must not allocate */ - return false; - } else if(aSizeNeeded!=*aSize && aMayAllocate) { + if(aSizeNeeded!=*aSize) { /* we may try to grow or shrink */ void *memory=moz_realloc(*aMemory, aSizeNeeded); @@ -248,7 +250,7 @@ void nsBidi::Free() /* SetPara ------------------------------------------------------------ */ nsresult nsBidi::SetPara(const char16_t *aText, int32_t aLength, - nsBidiLevel aParaLevel, nsBidiLevel *aEmbeddingLevels) + nsBidiLevel aParaLevel) { nsBidiDirection direction; @@ -302,32 +304,22 @@ nsresult nsBidi::SetPara(const char16_t *aText, int32_t aLength, return NS_ERROR_OUT_OF_MEMORY; } - /* are explicit levels specified? */ - if(aEmbeddingLevels==nullptr) { - /* no: determine explicit levels according to the (Xn) rules */\ - if(GETLEVELSMEMORY(aLength)) { - mLevels=mLevelsMemory; - ResolveExplicitLevels(&direction); - } else { - return NS_ERROR_OUT_OF_MEMORY; - } + /* determine explicit levels according to the (Xn) rules */ + if(GETLEVELSMEMORY(aLength)) { + mLevels=mLevelsMemory; + ResolveExplicitLevels(&direction, aText); } else { - /* set BN for all explicit codes, check that all levels are aParaLevel..NSBIDI_MAX_EXPLICIT_LEVEL */ - mLevels=aEmbeddingLevels; - nsresult rv = CheckExplicitLevels(&direction); - if(NS_FAILED(rv)) { - return rv; - } + return NS_ERROR_OUT_OF_MEMORY; } /* allocate isolate memory */ if (mIsolateCount <= SIMPLE_ISOLATES_SIZE) { mIsolates = mSimpleIsolates; } else { - if (mIsolateCount <= (int32_t) mIsolatesSize) { + if (mIsolateCount * sizeof(Isolate) <= mIsolatesSize) { mIsolates = mIsolatesMemory; } else { - if (GETINITIALISOLATESMEMORY(mIsolateCount)) { + if (GETISOLATESMEMORY(mIsolateCount)) { mIsolates = mIsolatesMemory; } else { return NS_ERROR_OUT_OF_MEMORY; @@ -368,7 +360,7 @@ nsresult nsBidi::SetPara(const char16_t *aText, int32_t aLength, * Examples for "insignificant" ones are empty embeddings * LRE-PDF, LRE-RLE-PDF-PDF, etc. */ - if(aEmbeddingLevels==nullptr && !(mFlags&DIRPROP_FLAG_MULTI_RUNS)) { + if(!(mFlags&DIRPROP_FLAG_MULTI_RUNS)) { ResolveImplicitLevels(0, aLength, GET_LR_FROM_LEVEL(mParaLevel), GET_LR_FROM_LEVEL(mParaLevel)); @@ -585,6 +577,334 @@ void nsBidi::GetDirProps(const char16_t *aText) mFlags = flags; } +/* Functions for handling paired brackets ----------------------------------- */ + +/* In the mIsoRuns array, the first entry is used for text outside of any + isolate sequence. Higher entries are used for each more deeply nested + isolate sequence. + mIsoRunLast is the index of the last used entry. + The mOpenings array is used to note the data of opening brackets not yet + matched by a closing bracket, or matched but still susceptible to change + level. + Each isoRun entry contains the index of the first and + one-after-last openings entries for pending opening brackets it + contains. The next mOpenings entry to use is the one-after-last of the + most deeply nested isoRun entry. + mIsoRuns entries also contain their current embedding level and the bidi + class of the last-encountered strong character, since these will be needed + to resolve the level of paired brackets. */ + +nsBidi::BracketData::BracketData(const nsBidi *aBidi) +{ + mIsoRunLast = 0; + mIsoRuns[0].start = 0; + mIsoRuns[0].limit = 0; + mIsoRuns[0].level = aBidi->mParaLevel; + mIsoRuns[0].lastStrong = mIsoRuns[0].lastBase = mIsoRuns[0].contextDir = + GET_LR_FROM_LEVEL(aBidi->mParaLevel); + mIsoRuns[0].contextPos = 0; + mOpenings = mSimpleOpenings; + mOpeningsCount = SIMPLE_OPENINGS_COUNT; + mOpeningsMemory = nullptr; +} + +nsBidi::BracketData::~BracketData() +{ + free(mOpeningsMemory); +} + +/* LRE, LRO, RLE, RLO, PDF */ +void +nsBidi::BracketData::ProcessBoundary(int32_t aLastDirControlCharPos, + nsBidiLevel aContextLevel, + nsBidiLevel aEmbeddingLevel, + const DirProp* aDirProps) +{ + IsoRun& lastIsoRun = mIsoRuns[mIsoRunLast]; + if (DIRPROP_FLAG(aDirProps[aLastDirControlCharPos]) & MASK_ISO) { /* after an isolate */ + return; + } + if (NO_OVERRIDE(aEmbeddingLevel) > NO_OVERRIDE(aContextLevel)) { /* not PDF */ + aContextLevel = aEmbeddingLevel; + } + lastIsoRun.limit = lastIsoRun.start; + lastIsoRun.level = aEmbeddingLevel; + lastIsoRun.lastStrong = lastIsoRun.lastBase = lastIsoRun.contextDir = + GET_LR_FROM_LEVEL(aContextLevel); + lastIsoRun.contextPos = aLastDirControlCharPos; +} + +/* LRI or RLI */ +void +nsBidi::BracketData::ProcessLRI_RLI(nsBidiLevel aLevel) +{ + MOZ_ASSERT(mIsoRunLast <= NSBIDI_MAX_EXPLICIT_LEVEL); + IsoRun& lastIsoRun = mIsoRuns[mIsoRunLast]; + lastIsoRun.lastBase = O_N; + IsoRun& currIsoRun = mIsoRuns[++mIsoRunLast]; + currIsoRun.start = currIsoRun.limit = lastIsoRun.limit; + currIsoRun.level = aLevel; + currIsoRun.lastStrong = currIsoRun.lastBase = currIsoRun.contextDir = + GET_LR_FROM_LEVEL(aLevel); + currIsoRun.contextPos = 0; +} + +/* PDI */ +void +nsBidi::BracketData::ProcessPDI() +{ + mIsoRuns[mIsoRunLast].lastBase = O_N; +} + +/* newly found opening bracket: create an openings entry */ +bool /* return true if success */ +nsBidi::BracketData::AddOpening(char16_t aMatch, int32_t aPosition) +{ + IsoRun& lastIsoRun = mIsoRuns[mIsoRunLast]; + if (lastIsoRun.limit >= mOpeningsCount) { /* no available new entry */ + if (!GETOPENINGSMEMORY(lastIsoRun.limit * 2)) { + return false; + } + if (mOpenings == mSimpleOpenings) { + memcpy(mOpeningsMemory, mSimpleOpenings, + SIMPLE_OPENINGS_COUNT * sizeof(Opening)); + } + mOpenings = mOpeningsMemory; /* may have changed */ + mOpeningsCount = mOpeningsSize / sizeof(Opening); + } + Opening& o = mOpenings[lastIsoRun.limit]; + o.position = aPosition; + o.match = aMatch; + o.contextDir = lastIsoRun.contextDir; + o.contextPos = lastIsoRun.contextPos; + o.flags = 0; + lastIsoRun.limit++; + return true; +} + +/* change N0c1 to N0c2 when a preceding bracket is assigned the embedding level */ +void +nsBidi::BracketData::FixN0c(int32_t aOpeningIndex, int32_t aNewPropPosition, + DirProp aNewProp, DirProp* aDirProps) +{ + /* This function calls itself recursively */ + IsoRun& lastIsoRun = mIsoRuns[mIsoRunLast]; + for (int32_t k = aOpeningIndex + 1; k < lastIsoRun.limit; k++) { + Opening& o = mOpenings[k]; + if (o.match >= 0) { /* not an N0c match */ + continue; + } + if (aNewPropPosition < o.contextPos) { + break; + } + int32_t openingPosition = o.position; + if (aNewPropPosition >= openingPosition) { + continue; + } + if (aNewProp == o.contextDir) { + break; + } + aDirProps[openingPosition] = aNewProp; + int32_t closingPosition = -(o.match); + aDirProps[closingPosition] = aNewProp; + o.match = 0; /* prevent further changes */ + FixN0c(k, openingPosition, aNewProp, aDirProps); + FixN0c(k, closingPosition, aNewProp, aDirProps); + } +} + +/* process closing bracket */ +DirProp /* return L or R if N0b or N0c, ON if N0d */ +nsBidi::BracketData::ProcessClosing(int32_t aOpenIdx, int32_t aPosition, + DirProp* aDirProps) +{ + IsoRun& lastIsoRun = mIsoRuns[mIsoRunLast]; + Opening& o = mOpenings[aOpenIdx]; + DirProp newProp; + DirProp direction = GET_LR_FROM_LEVEL(lastIsoRun.level); + bool stable = true; // assume stable until proved otherwise + + /* The stable flag is set when brackets are paired and their + level is resolved and cannot be changed by what will be + found later in the source string. + An unstable match can occur only when applying N0c, where + the resolved level depends on the preceding context, and + this context may be affected by text occurring later. + Example: RTL paragraph containing: abc[(latin) HEBREW] + When the closing parenthesis is encountered, it appears + that N0c1 must be applied since 'abc' sets an opposite + direction context and both parentheses receive level 2. + However, when the closing square bracket is processed, + N0b applies because of 'HEBREW' being included within the + brackets, thus the square brackets are treated like R and + receive level 1. However, this changes the preceding + context of the opening parenthesis, and it now appears + that N0c2 must be applied to the parentheses rather than + N0c1. */ + + if ((direction == 0 && o.flags & FOUND_L) || + (direction == 1 && o.flags & FOUND_R)) { /* N0b */ + newProp = direction; + } else if (o.flags & (FOUND_L|FOUND_R)) { /* N0c */ + /* it is stable if there is no containing pair or in + conditions too complicated and not worth checking */ + stable = (aOpenIdx == lastIsoRun.start); + if (direction != o.contextDir) { + newProp = o.contextDir; /* N0c1 */ + } else { + newProp = direction; /* N0c2 */ + } + } else { + /* forget this and any brackets nested within this pair */ + lastIsoRun.limit = aOpenIdx; + return O_N; /* N0d */ + } + aDirProps[o.position] = newProp; + aDirProps[aPosition] = newProp; + /* Update nested N0c pairs that may be affected */ + FixN0c(aOpenIdx, o.position, newProp, aDirProps); + if (stable) { + /* forget any brackets nested within this pair */ + lastIsoRun.limit = aOpenIdx; + } else { + int32_t k; + o.match = -aPosition; + /* neutralize any unmatched opening between the current pair */ + for (k = aOpenIdx + 1; k < lastIsoRun.limit; k++) { + Opening& oo = mOpenings[k]; + if (oo.position > aPosition) { + break; + } + if (oo.match > 0) { + oo.match = 0; + } + } + } + return newProp; +} + +static inline bool +IsMatchingCloseBracket(char16_t aCh1, char16_t aCh2) +{ + // U+232A RIGHT-POINTING ANGLE BRACKET and U+3009 RIGHT ANGLE BRACKET + // are canonical equivalents, so we special-case them here. + return (aCh1 == aCh2) || + (aCh1 == 0x232A && aCh2 == 0x3009) || + (aCh2 == 0x232A && aCh1 == 0x3009); +} + +/* Handle strong characters, digits and candidates for closing brackets. */ +/* Returns true if success. (The only failure mode is an OOM when trying + to allocate memory for the Openings array.) */ +bool +nsBidi::BracketData::ProcessChar(int32_t aPosition, char16_t aCh, + DirProp* aDirProps, nsBidiLevel* aLevels) +{ + IsoRun& lastIsoRun = mIsoRuns[mIsoRunLast]; + DirProp newProp; + DirProp dirProp = aDirProps[aPosition]; + nsBidiLevel level = aLevels[aPosition]; + if (dirProp == O_N) { + /* First see if it is a matching closing bracket. Hopefully, this is + more efficient than checking if it is a closing bracket at all */ + for (int32_t idx = lastIsoRun.limit - 1; idx >= lastIsoRun.start; idx--) { + if (!IsMatchingCloseBracket(aCh, mOpenings[idx].match)) { + continue; + } + /* We have a match */ + newProp = ProcessClosing(idx, aPosition, aDirProps); + if (newProp == O_N) { /* N0d */ + aCh = 0; /* prevent handling as an opening */ + break; + } + lastIsoRun.lastBase = O_N; + lastIsoRun.contextDir = newProp; + lastIsoRun.contextPos = aPosition; + if (level & NSBIDI_LEVEL_OVERRIDE) { /* X4, X5 */ + newProp = GET_LR_FROM_LEVEL(level); + lastIsoRun.lastStrong = newProp; + uint16_t flag = DIRPROP_FLAG(newProp); + for (int32_t i = lastIsoRun.start; i < idx; i++) { + mOpenings[i].flags |= flag; + } + /* matching brackets are not overridden by LRO/RLO */ + aLevels[aPosition] &= ~NSBIDI_LEVEL_OVERRIDE; + } + /* matching brackets are not overridden by LRO/RLO */ + aLevels[mOpenings[idx].position] &= ~NSBIDI_LEVEL_OVERRIDE; + return true; + } + /* We get here only if the ON character is not a matching closing + bracket or it is a case of N0d */ + /* Now see if it is an opening bracket */ + char16_t match = GetPairedBracket(aCh); + if (match != aCh && /* has a matching char */ + GetPairedBracketType(aCh) == PAIRED_BRACKET_TYPE_OPEN) { /* opening bracket */ + if (!AddOpening(match, aPosition)) { + return false; + } + } + } + if (level & NSBIDI_LEVEL_OVERRIDE) { /* X4, X5 */ + newProp = GET_LR_FROM_LEVEL(level); + if (dirProp != S && dirProp != WS && dirProp != O_N) { + aDirProps[aPosition] = newProp; + } + lastIsoRun.lastBase = newProp; + lastIsoRun.lastStrong = newProp; + lastIsoRun.contextDir = newProp; + lastIsoRun.contextPos = aPosition; + } else if (IS_STRONG_TYPE(dirProp)) { + newProp = DirFromStrong(dirProp); + lastIsoRun.lastBase = dirProp; + lastIsoRun.lastStrong = dirProp; + lastIsoRun.contextDir = newProp; + lastIsoRun.contextPos = aPosition; + } else if (dirProp == EN) { + lastIsoRun.lastBase = EN; + if (lastIsoRun.lastStrong == L) { + newProp = L; /* W7 */ + aDirProps[aPosition] = ENL; + lastIsoRun.contextDir = L; + lastIsoRun.contextPos = aPosition; + } else { + newProp = R; /* N0 */ + if (lastIsoRun.lastStrong == AL) { + aDirProps[aPosition] = AN; /* W2 */ + } else { + aDirProps[aPosition] = ENR; + } + lastIsoRun.contextDir = R; + lastIsoRun.contextPos = aPosition; + } + } else if (dirProp == AN) { + newProp = R; /* N0 */ + lastIsoRun.lastBase = AN; + lastIsoRun.contextDir = R; + lastIsoRun.contextPos = aPosition; + } else if (dirProp == NSM) { + /* if the last real char was ON, change NSM to ON so that it + will stay ON even if the last real char is a bracket which + may be changed to L or R */ + newProp = lastIsoRun.lastBase; + if (newProp == O_N) { + aDirProps[aPosition] = newProp; + } + } else { + newProp = dirProp; + lastIsoRun.lastBase = dirProp; + } + if (IS_STRONG_TYPE(newProp)) { + uint16_t flag = DIRPROP_FLAG(DirFromStrong(newProp)); + for (int32_t i = lastIsoRun.start; i < lastIsoRun.limit; i++) { + if (aPosition > mOpenings[i].position) { + mOpenings[i].flags |= flag; + } + } + } + return true; +} + /* perform (X1)..(X9) ------------------------------------------------------- */ /* @@ -635,7 +955,7 @@ void nsBidi::GetDirProps(const char16_t *aText) * This implementation assumes that NSBIDI_MAX_EXPLICIT_LEVEL is odd. */ -void nsBidi::ResolveExplicitLevels(nsBidiDirection *aDirection) +void nsBidi::ResolveExplicitLevels(nsBidiDirection *aDirection, const char16_t *aText) { DirProp *dirProps=mDirProps; nsBidiLevel *levels=mLevels; @@ -655,9 +975,23 @@ void nsBidi::ResolveExplicitLevels(nsBidiDirection *aDirection) if(direction!=NSBIDI_MIXED) { /* not mixed directionality: levels don't matter - trailingWSStart will be 0 */ } else if(!(flags&(MASK_EXPLICIT|MASK_ISO))) { + BracketData bracketData(this); /* no embeddings, set all levels to the paragraph level */ for(i=0; i=NSBIDI_MAX_EXPLICIT_LEVEL but we need one more entry as base */ - uint32_t stackLast = 0; + int32_t stackLast = 0; int32_t overflowIsolateCount = 0; int32_t overflowEmbeddingCount = 0; int32_t validIsolateCount = 0; + BracketData bracketData(this); + stack[0] = level; /* recalculate the flags */ @@ -689,24 +1026,25 @@ void nsBidi::ResolveExplicitLevels(nsBidiDirection *aDirection) case RLO: /* (X2, X3, X4, X5) */ flags |= DIRPROP_FLAG(BN); + levels[i] = previousLevel; if (dirProp == LRE || dirProp == LRO) { newLevel = (embeddingLevel + 2) & ~(NSBIDI_LEVEL_OVERRIDE | 1); /* least greater even level */ } else { newLevel = ((embeddingLevel & ~NSBIDI_LEVEL_OVERRIDE) + 1) | 1; /* least greater odd level */ } if(newLevel <= NSBIDI_MAX_EXPLICIT_LEVEL && overflowIsolateCount == 0 && overflowEmbeddingCount == 0) { + lastDirControlCharPos = i; embeddingLevel = newLevel; if (dirProp == LRO || dirProp == RLO) { embeddingLevel |= NSBIDI_LEVEL_OVERRIDE; } stackLast++; stack[stackLast] = embeddingLevel; - /* we don't need to set UBIDI_LEVEL_OVERRIDE off for LRE and RLE + /* we don't need to set NSBIDI_LEVEL_OVERRIDE off for LRE and RLE since this has already been done for newLevel which is the source for embeddingLevel. */ } else { - dirProps[i] |= IGNORE_CC; if (overflowIsolateCount == 0) { overflowEmbeddingCount++; } @@ -716,38 +1054,41 @@ void nsBidi::ResolveExplicitLevels(nsBidiDirection *aDirection) case PDF: /* (X7) */ flags |= DIRPROP_FLAG(BN); + levels[i] = previousLevel; /* handle all the overflow cases first */ if (overflowIsolateCount) { - dirProps[i] |= IGNORE_CC; break; } if (overflowEmbeddingCount) { - dirProps[i] |= IGNORE_CC; overflowEmbeddingCount--; break; } if (stackLast > 0 && stack[stackLast] < ISOLATE) { /* not an isolate entry */ + lastDirControlCharPos = i; stackLast--; embeddingLevel = stack[stackLast]; - } else { - dirProps[i] |= IGNORE_CC; } break; case LRI: case RLI: - if (embeddingLevel != previousLevel) { - previousLevel = embeddingLevel; + flags |= DIRPROP_FLAG(O_N) | DIRPROP_FLAG_LR(embeddingLevel); + levels[i] = NO_OVERRIDE(embeddingLevel); + if (NO_OVERRIDE(embeddingLevel) != NO_OVERRIDE(previousLevel)) { + bracketData.ProcessBoundary(lastDirControlCharPos, previousLevel, + embeddingLevel, mDirProps); + flags |= DIRPROP_FLAG_MULTI_RUNS; } + previousLevel = embeddingLevel; /* (X5a, X5b) */ - flags |= DIRPROP_FLAG(O_N) | DIRPROP_FLAG(BN) | DIRPROP_FLAG_LR(embeddingLevel); - level = embeddingLevel; if (dirProp == LRI) { newLevel = (embeddingLevel + 2) & ~(NSBIDI_LEVEL_OVERRIDE | 1); /* least greater even level */ } else { newLevel = ((embeddingLevel & ~NSBIDI_LEVEL_OVERRIDE) + 1) | 1; /* least greater odd level */ } if (newLevel <= NSBIDI_MAX_EXPLICIT_LEVEL && overflowIsolateCount == 0 && overflowEmbeddingCount == 0) { + flags |= DIRPROP_FLAG(dirProp); + lastDirControlCharPos = i; previousLevel = embeddingLevel; validIsolateCount++; if (validIsolateCount > mIsolateCount) { @@ -756,32 +1097,51 @@ void nsBidi::ResolveExplicitLevels(nsBidiDirection *aDirection) embeddingLevel = newLevel; stackLast++; stack[stackLast] = embeddingLevel + ISOLATE; + bracketData.ProcessLRI_RLI(embeddingLevel); } else { - dirProps[i] |= IGNORE_CC; + /* make it so that it is handled by AdjustWSLevels() */ + dirProps[i] = WS; overflowIsolateCount++; } break; case PDI: + if (NO_OVERRIDE(embeddingLevel) != NO_OVERRIDE(previousLevel)) { + bracketData.ProcessBoundary(lastDirControlCharPos, previousLevel, + embeddingLevel, mDirProps); + flags |= DIRPROP_FLAG_MULTI_RUNS; + } /* (X6a) */ if (overflowIsolateCount) { - dirProps[i] |= IGNORE_CC; overflowIsolateCount--; + /* make it so that it is handled by AdjustWSLevels() */ + dirProps[i] = WS; } else if (validIsolateCount) { + flags |= DIRPROP_FLAG(PDI); + lastDirControlCharPos = i; overflowEmbeddingCount = 0; while (stack[stackLast] < ISOLATE) { /* pop embedding entries */ /* until the last isolate entry */ stackLast--; + + // Since validIsolateCount is true, there must be an isolate entry + // on the stack, so the stack is guaranteed to not be empty. + // Still, to eliminate a warning from coverity, we use an assertion. + MOZ_ASSERT(stackLast > 0); } stackLast--; /* pop also the last isolate entry */ + MOZ_ASSERT(stackLast >= 0); // For coverity validIsolateCount--; + bracketData.ProcessPDI(); } else { - dirProps[i] |= IGNORE_CC; + /* make it so that it is handled by AdjustWSLevels() */ + dirProps[i] = WS; } embeddingLevel = stack[stackLast] & ~ISOLATE; - previousLevel = level = embeddingLevel; - flags |= DIRPROP_FLAG(O_N) | DIRPROP_FLAG(BN) | DIRPROP_FLAG_LR(embeddingLevel); + flags |= DIRPROP_FLAG(O_N) | DIRPROP_FLAG_LR(embeddingLevel); + previousLevel = embeddingLevel; + levels[i] = NO_OVERRIDE(embeddingLevel); break; case B: @@ -794,40 +1154,32 @@ void nsBidi::ResolveExplicitLevels(nsBidiDirection *aDirection) case BN: /* BN, LRE, RLE, and PDF are supposed to be removed (X9) */ /* they will get their levels set correctly in AdjustWSLevels() */ - flags|=DIRPROP_FLAG(BN); + levels[i] = previousLevel; + flags |= DIRPROP_FLAG(BN); break; default: /* all other types get the "real" level */ - level = embeddingLevel; - if(embeddingLevel != previousLevel) { - previousLevel = embeddingLevel; + if (NO_OVERRIDE(embeddingLevel) != NO_OVERRIDE(previousLevel)) { + bracketData.ProcessBoundary(lastDirControlCharPos, previousLevel, + embeddingLevel, mDirProps); + flags |= DIRPROP_FLAG_MULTI_RUNS; + if (embeddingLevel & NSBIDI_LEVEL_OVERRIDE) { + flags |= DIRPROP_FLAG_O(embeddingLevel); + } else { + flags |= DIRPROP_FLAG_E(embeddingLevel); + } } - - if (level & NSBIDI_LEVEL_OVERRIDE) { - flags |= DIRPROP_FLAG_LR(level); - } else { - flags |= DIRPROP_FLAG(dirProp); + previousLevel = embeddingLevel; + levels[i] = embeddingLevel; + if (!bracketData.ProcessChar(i, aText[i], mDirProps, mLevels)) { + NS_WARNING("BracketData::ProcessChar failed, out of memory?"); + *aDirection = NSBIDI_LTR; + return; } + flags |= DIRPROP_FLAG(dirProps[i]); break; } - - /* - * We need to set reasonable levels even on BN codes and - * explicit codes because we will later look at same-level runs (X10). - */ - levels[i]=level; - if (i > 0 && levels[i - 1] != level) { - flags |= DIRPROP_FLAG_MULTI_RUNS; - if (level & NSBIDI_LEVEL_OVERRIDE) { - flags |= DIRPROP_FLAG_O(level); - } else { - flags |= DIRPROP_FLAG_E(level); - } - } - if (DIRPROP_FLAG(dirProp) & MASK_ISO) { - level = embeddingLevel; - } } if(flags&MASK_EMBEDDING) { @@ -844,63 +1196,6 @@ void nsBidi::ResolveExplicitLevels(nsBidiDirection *aDirection) *aDirection = direction; } -/* - * Use a pre-specified embedding levels array: - * - * Adjust the directional properties for overrides (->LEVEL_OVERRIDE), - * ignore all explicit codes (X9), - * and check all the preset levels. - * - * Recalculate the flags to have them reflect the real properties - * after taking the explicit embeddings into account. - */ -nsresult nsBidi::CheckExplicitLevels(nsBidiDirection *aDirection) -{ - const DirProp *dirProps=mDirProps; - DirProp dirProp; - nsBidiLevel *levels=mLevels; - int32_t isolateCount = 0; - - int32_t i, length=mLength; - Flags flags=0; /* collect all directionalities in the text */ - nsBidiLevel level, paraLevel=mParaLevel; - mIsolateCount = 0; - - for(i=0; i mIsolateCount) { - mIsolateCount = isolateCount; - } - } else if (dirProp == PDI) { - isolateCount--; - } - if(level&NSBIDI_LEVEL_OVERRIDE) { - /* keep the override flag in levels[i] but adjust the flags */ - level&=~NSBIDI_LEVEL_OVERRIDE; /* make the range check below simpler */ - flags|=DIRPROP_FLAG_O(level); - } else { - /* set the flags */ - flags|=DIRPROP_FLAG_E(level)|DIRPROP_FLAG(dirProp); - } - if(level= 0) { start1 = mIsolates[mIsolateCount].start1; stateImp = mIsolates[mIsolateCount].stateImp; levState.state = mIsolates[mIsolateCount].state; mIsolateCount--; } else { + levState.startON = -1; start1 = aStart; if (dirProps[aStart] == NSM) { stateImp = 1 + aSOR; @@ -1227,7 +1522,7 @@ void nsBidi::ResolveImplicitLevels(int32_t aStart, int32_t aLimit, gprop = aEOR; } else { DirProp prop; - prop = PURE_DIRPROP(dirProps[i]); + prop = dirProps[i]; gprop = groupProp[prop]; } oldStateImp = stateImp; @@ -1298,14 +1593,14 @@ void nsBidi::AdjustWSLevels() i=mTrailingWSStart; while(i>0) { /* reset a sequence of WS/BN before eop and B/S to the paragraph paraLevel */ - while (i > 0 && DIRPROP_FLAG(PURE_DIRPROP(dirProps[--i])) & MASK_WS) { + while (i > 0 && DIRPROP_FLAG(dirProps[--i]) & MASK_WS) { levels[i]=paraLevel; } /* reset BN to the next character's paraLevel until B/S, which restarts above loop */ /* here, i+1 is guaranteed to be 0) { - flag = DIRPROP_FLAG(PURE_DIRPROP(dirProps[--i])); + flag = DIRPROP_FLAG(dirProps[--i]); if(flag&MASK_BN_EXPLICIT) { levels[i]=levels[i+1]; } else if(flag&MASK_B_S) { @@ -1328,252 +1623,6 @@ nsresult nsBidi::GetParaLevel(nsBidiLevel* aParaLevel) *aParaLevel = mParaLevel; return NS_OK; } -#ifdef FULL_BIDI_ENGINE - -/* -------------------------------------------------------------------------- */ - -nsresult nsBidi::GetLength(int32_t* aLength) -{ - *aLength = mLength; - return NS_OK; -} - -/* - * General remarks about the functions in this section: - * - * These functions deal with the aspects of potentially mixed-directional - * text in a single paragraph or in a line of a single paragraph - * which has already been processed according to - * the Unicode 6.3 Bidi algorithm as defined in - * http://www.unicode.org/unicode/reports/tr9/ , version 28, - * also described in The Unicode Standard, Version 6.3.0 . - * - * This means that there is a nsBidi object with a levels - * and a dirProps array. - * paraLevel and direction are also set. - * Only if the length of the text is zero, then levels==dirProps==nullptr. - * - * The overall directionality of the paragraph - * or line is used to bypass the reordering steps if possible. - * Even purely RTL text does not need reordering there because - * the getLogical/VisualIndex() functions can compute the - * index on the fly in such a case. - * - * The implementation of the access to same-level-runs and of the reordering - * do attempt to provide better performance and less memory usage compared to - * a direct implementation of especially rule (L2) with an array of - * one (32-bit) integer per text character. - * - * Here, the levels array is scanned as soon as necessary, and a vector of - * same-level-runs is created. Reordering then is done on this vector. - * For each run of text positions that were resolved to the same level, - * only 8 bytes are stored: the first text position of the run and the visual - * position behind the run after reordering. - * One sign bit is used to hold the directionality of the run. - * This is inefficient if there are many very short runs. If the average run - * length is <2, then this uses more memory. - * - * In a further attempt to save memory, the levels array is never changed - * after all the resolution rules (Xn, Wn, Nn, In). - * Many functions have to consider the field trailingWSStart: - * if it is less than length, then there is an implicit trailing run - * at the paraLevel, - * which is not reflected in the levels array. - * This allows a line nsBidi object to use the same levels array as - * its paragraph parent object. - * - * When a nsBidi object is created for a line of a paragraph, then the - * paragraph's levels and dirProps arrays are reused by way of setting - * a pointer into them, not by copying. This again saves memory and forbids to - * change the now shared levels for (L1). - */ -nsresult nsBidi::SetLine(const nsBidi* aParaBidi, int32_t aStart, int32_t aLimit) -{ - nsBidi* pParent = (nsBidi*)aParaBidi; - int32_t length; - - /* check the argument values */ - if(pParent==nullptr) { - return NS_ERROR_INVALID_POINTER; - } else if(aStart < 0 || aStart >= aLimit || aLimit > pParent->mLength) { - return NS_ERROR_INVALID_ARG; - } - - /* set members from our aParaBidi parent */ - length = mLength = aLimit - aStart; - mParaLevel=pParent->mParaLevel; - - mRuns=nullptr; - mFlags=0; - - mDirProps=pParent->mDirProps+aStart; - mLevels=pParent->mLevels+aStart; - mRunCount=-1; - - if(pParent->mDirection!=NSBIDI_MIXED) { - /* the parent is already trivial */ - mDirection=pParent->mDirection; - - /* - * The parent's levels are all either - * implicitly or explicitly ==paraLevel; - * do the same here. - */ - if(pParent->mTrailingWSStart<=aStart) { - mTrailingWSStart=0; - } else if(pParent->mTrailingWSStartmTrailingWSStart-aStart; - } else { - mTrailingWSStart=length; - } - } else { - const nsBidiLevel *levels=mLevels; - int32_t i, trailingWSStart; - nsBidiLevel level; - - SetTrailingWSStart(); - trailingWSStart=mTrailingWSStart; - - /* recalculate pLineBidi->direction */ - if(trailingWSStart==0) { - /* all levels are at paraLevel */ - mDirection=(nsBidiDirection)(mParaLevel&1); - } else { - /* get the level of the first character */ - level=levels[0]&1; - - /* if there is anything of a different level, then the line is mixed */ - if(trailingWSStart0 && DIRPROP_FLAG(dirProps[start-1])&MASK_WS) { - --start; - } - - /* if the WS run can be merged with the previous run then do so here */ - while(start>0 && levels[start-1]==paraLevel) { - --start; - } - - mTrailingWSStart=start; -} - -nsresult nsBidi::GetLevelAt(int32_t aCharIndex, nsBidiLevel* aLevel) -{ - /* return paraLevel if in the trailing WS run, otherwise the real level */ - if(aCharIndex<0 || mLength<=aCharIndex) { - *aLevel = 0; - } else if(mDirection!=NSBIDI_MIXED || aCharIndex>=mTrailingWSStart) { - *aLevel = mParaLevel; - } else { - *aLevel = mLevels[aCharIndex]; - } - return NS_OK; -} - -nsresult nsBidi::GetLevels(nsBidiLevel** aLevels) -{ - int32_t start, length; - - length = mLength; - if(length<=0) { - *aLevels = nullptr; - return NS_ERROR_INVALID_ARG; - } - - start = mTrailingWSStart; - if(start==length) { - /* the current levels array reflects the WS run */ - *aLevels = mLevels; - return NS_OK; - } - - /* - * After the previous if(), we know that the levels array - * has an implicit trailing WS run and therefore does not fully - * reflect itself all the levels. - * This must be a nsBidi object for a line, and - * we need to create a new levels array. - */ - - if(GETLEVELSMEMORY(length)) { - nsBidiLevel *levels=mLevelsMemory; - - if(start>0 && levels!=mLevels) { - memcpy(levels, mLevels, start); - } - memset(levels+start, mParaLevel, length-start); - - /* this new levels array is set for the line and reflects the WS run */ - mTrailingWSStart=length; - *aLevels=mLevels=levels; - return NS_OK; - } else { - /* out of memory */ - *aLevels = nullptr; - return NS_ERROR_OUT_OF_MEMORY; - } -} -#endif // FULL_BIDI_ENGINE nsresult nsBidi::GetCharTypeAt(int32_t aCharIndex, nsCharType* pType) { @@ -2032,454 +2081,3 @@ bool nsBidi::PrepareReorder(const nsBidiLevel *aLevels, int32_t aLength, return true; } - -#ifdef FULL_BIDI_ENGINE -/* API functions for logical<->visual mapping ------------------------------- */ - -nsresult nsBidi::GetVisualIndex(int32_t aLogicalIndex, int32_t* aVisualIndex) { - int32_t visualIndex = NSBIDI_MAP_NOWHERE; - - if(aLogicalIndex<0 || mLength<=aLogicalIndex) { - return NS_ERROR_INVALID_ARG; - } else { - /* we can do the trivial cases without the runs array */ - switch(mDirection) { - case NSBIDI_LTR: - *aVisualIndex = aLogicalIndex; - return NS_OK; - case NSBIDI_RTL: - *aVisualIndex = mLength-aLogicalIndex-1; - return NS_OK; - default: - if(mRunCount<0 && !GetRuns()) { - return NS_ERROR_OUT_OF_MEMORY; - } else { - Run *runs=mRuns; - int32_t i, visualStart=0, offset, length; - - /* linear search for the run, search on the visual runs */ - for (i = 0; i < mRunCount; ++i) { - length=runs[i].visualLimit-visualStart; - offset=aLogicalIndex-GET_INDEX(runs[i].logicalStart); - if(offset>=0 && offset= mRunCount) { - *aVisualIndex = NSBIDI_MAP_NOWHERE; - return NS_OK; - } - } - } - } - - *aVisualIndex = visualIndex; - return NS_OK; -} - -nsresult nsBidi::GetLogicalIndex(int32_t aVisualIndex, int32_t *aLogicalIndex) -{ - if(aVisualIndex<0 || mLength<=aVisualIndex) { - return NS_ERROR_INVALID_ARG; - } - - /* we can do the trivial cases without the runs array */ - if (mDirection == NSBIDI_LTR) { - *aLogicalIndex = aVisualIndex; - return NS_OK; - } else if (mDirection == NSBIDI_RTL) { - *aLogicalIndex = mLength - aVisualIndex - 1; - return NS_OK; - } - - if(mRunCount<0 && !GetRuns()) { - return NS_ERROR_OUT_OF_MEMORY; - } - - Run *runs=mRuns; - int32_t i, runCount=mRunCount, start; - - if(runCount<=10) { - /* linear search for the run */ - for(i=0; aVisualIndex>=runs[i].visualLimit; ++i) {} - } else { - /* binary search for the run */ - int32_t start=0, limit=runCount; - - /* the middle if() will guaranteed find the run, we don't need a loop limit */ - for(;;) { - i=(start+limit)/2; - if(aVisualIndex>=runs[i].visualLimit) { - start=i+1; - } else if(i==0 || aVisualIndex>=runs[i-1].visualLimit) { - break; - } else { - limit=i; - } - } - } - - start=runs[i].logicalStart; - if(IS_EVEN_RUN(start)) { - /* LTR */ - /* the offset in runs[i] is aVisualIndex-runs[i-1].visualLimit */ - if(i>0) { - aVisualIndex-=runs[i-1].visualLimit; - } - *aLogicalIndex = GET_INDEX(start)+aVisualIndex; - return NS_OK; - } else { - /* RTL */ - *aLogicalIndex = GET_INDEX(start)+runs[i].visualLimit-aVisualIndex-1; - return NS_OK; - } -} - -nsresult nsBidi::GetLogicalMap(int32_t *aIndexMap) -{ - nsresult rv; - - /* CountRuns() checks for VALID_PARA_OR_LINE */ - rv = CountRuns(nullptr); - if(NS_FAILED(rv)) { - return rv; - } else if(aIndexMap==nullptr) { - return NS_ERROR_INVALID_ARG; - } else { - /* fill a logical-to-visual index map using the runs[] */ - int32_t visualStart, visualLimit, j; - int32_t logicalStart; - Run *runs = mRuns; - if (mLength <= 0) { - return NS_OK; - } - - visualStart = 0; - for (j = 0; j < mRunCount; ++j) { - logicalStart = GET_INDEX(runs[j].logicalStart); - visualLimit = runs[j].visualLimit; - if (IS_EVEN_RUN(runs[j].logicalStart)) { - do { /* LTR */ - aIndexMap[logicalStart++] = visualStart++; - } while (visualStart < visualLimit); - } else { - logicalStart += visualLimit-visualStart; /* logicalLimit */ - do { /* RTL */ - aIndexMap[--logicalStart] = visualStart++; - } while (visualStart < visualLimit); - } - /* visualStart==visualLimit; */ - } - } - return NS_OK; -} - -nsresult nsBidi::GetVisualMap(int32_t *aIndexMap) -{ - int32_t* runCount=nullptr; - nsresult rv; - - if(aIndexMap==nullptr) { - return NS_ERROR_INVALID_ARG; - } - - /* CountRuns() checks all of its and our arguments */ - rv = CountRuns(runCount); - if(NS_FAILED(rv)) { - return rv; - } else { - /* fill a visual-to-logical index map using the runs[] */ - Run *runs=mRuns, *runsLimit=runs+mRunCount; - int32_t logicalStart, visualStart, visualLimit; - - visualStart=0; - for(; runslogicalStart; - visualLimit=runs->visualLimit; - if(IS_EVEN_RUN(logicalStart)) { - do { /* LTR */ - *aIndexMap++ = logicalStart++; - } while(++visualStart=maxLevel */ - /* look for the first index of such a sequence */ - while(start=aLength) { - break; /* no more such sequences */ - } - - /* look for the limit of such a sequence (the index behind it) */ - for(limit=start; ++limit=maxLevel;) {} - - /* - * sos=start of sequence, eos=end of sequence - * - * The closed (inclusive) interval from sos to eos includes all the logical - * and visual indexes within this sequence. They are logically and - * visually contiguous and in the same range. - * - * For each run, the new visual index=sos+eos-old visual index; - * we pre-add sos+eos into sumOfSosEos -> - * new visual index=sumOfSosEos-old visual index; - */ - sumOfSosEos=start+limit-1; - - /* reorder each index in the sequence */ - do { - aIndexMap[start]=sumOfSosEos-aIndexMap[start]; - } while(++start=minLevel); - - return NS_OK; -} - -nsresult nsBidi::InvertMap(const int32_t *aSrcMap, int32_t *aDestMap, int32_t aLength) -{ - if(aSrcMap!=nullptr && aDestMap!=nullptr && aLength > 0) { - const int32_t *pi; - int32_t destLength = -1, count = 0; - /* find highest value and count positive indexes in srcMap */ - pi = aSrcMap + aLength; - while (pi > aSrcMap) { - if (*--pi > destLength) { - destLength = *pi; - } - if (*pi >= 0) { - count++; - } - } - destLength++; /* add 1 for origin 0 */ - if (count < destLength) { - /* we must fill unmatched destMap entries with -1 */ - memset(aDestMap, 0xFF, destLength * sizeof(int32_t)); - } - pi = aSrcMap + aLength; - while (aLength > 0) { - if (*--pi >= 0) { - aDestMap[*pi] = --aLength; - } else { - --aLength; - } - } - } - return NS_OK; -} - -int32_t nsBidi::doWriteReverse(const char16_t *src, int32_t srcLength, - char16_t *dest, uint16_t options) { - /* - * RTL run - - * - * RTL runs need to be copied to the destination in reverse order - * of code points, not code units, to keep Unicode characters intact. - * - * The general strategy for this is to read the source text - * in backward order, collect all code units for a code point - * (and optionally following combining characters, see below), - * and copy all these code units in ascending order - * to the destination for this run. - * - * Several options request whether combining characters - * should be kept after their base characters, - * whether Bidi control characters should be removed, and - * whether characters should be replaced by their mirror-image - * equivalent Unicode characters. - */ - int32_t i, j, destSize; - uint32_t c; - - /* optimize for several combinations of options */ - switch(options&(NSBIDI_REMOVE_BIDI_CONTROLS|NSBIDI_DO_MIRRORING|NSBIDI_KEEP_BASE_COMBINING)) { - case 0: - /* - * With none of the "complicated" options set, the destination - * run will have the same length as the source run, - * and there is no mirroring and no keeping combining characters - * with their base characters. - */ - destSize=srcLength; - - /* preserve character integrity */ - do { - /* i is always after the last code unit known to need to be kept in this segment */ - i=srcLength; - - /* collect code units for one base character */ - UTF_BACK_1(src, 0, srcLength); - - /* copy this base character */ - j=srcLength; - do { - *dest++=src[j++]; - } while(j0); - break; - case NSBIDI_KEEP_BASE_COMBINING: - /* - * Here, too, the destination - * run will have the same length as the source run, - * and there is no mirroring. - * We do need to keep combining characters with their base characters. - */ - destSize=srcLength; - - /* preserve character integrity */ - do { - /* i is always after the last code unit known to need to be kept in this segment */ - i=srcLength; - - /* collect code units and modifier letters for one base character */ - do { - UTF_PREV_CHAR(src, 0, srcLength, c); - } while(srcLength>0 && GetBidiCat(c) == eCharType_DirNonSpacingMark); - - /* copy this "user character" */ - j=srcLength; - do { - *dest++=src[j++]; - } while(j0); - break; - default: - /* - * With several "complicated" options set, this is the most - * general and the slowest copying of an RTL run. - * We will do mirroring, remove Bidi controls, and - * keep combining characters with their base characters - * as requested. - */ - if(!(options&NSBIDI_REMOVE_BIDI_CONTROLS)) { - i=srcLength; - } else { - /* we need to find out the destination length of the run, - which will not include the Bidi control characters */ - int32_t length=srcLength; - char16_t ch; - - i=0; - do { - ch=*src++; - if (!IsBidiControl((uint32_t)ch)) { - ++i; - } - } while(--length>0); - src-=srcLength; - } - destSize=i; - - /* preserve character integrity */ - do { - /* i is always after the last code unit known to need to be kept in this segment */ - i=srcLength; - - /* collect code units for one base character */ - UTF_PREV_CHAR(src, 0, srcLength, c); - if(options&NSBIDI_KEEP_BASE_COMBINING) { - /* collect modifier letters for this base character */ - while(srcLength>0 && GetBidiCat(c) == eCharType_DirNonSpacingMark) { - UTF_PREV_CHAR(src, 0, srcLength, c); - } - } - - if(options&NSBIDI_REMOVE_BIDI_CONTROLS && IsBidiControl(c)) { - /* do not copy this Bidi control character */ - continue; - } - - /* copy this "user character" */ - j=srcLength; - if(options&NSBIDI_DO_MIRRORING) { - /* mirror only the base character */ - c = GetMirroredChar(c); - - int32_t k=0; - UTF_APPEND_CHAR_UNSAFE(dest, k, c); - dest+=k; - j+=k; - } - while(j0); - break; - } /* end of switch */ - return destSize; -} - -nsresult nsBidi::WriteReverse(const char16_t *aSrc, int32_t aSrcLength, char16_t *aDest, uint16_t aOptions, int32_t *aDestSize) -{ - if( aSrc==nullptr || aSrcLength<0 || - aDest==nullptr - ) { - return NS_ERROR_INVALID_ARG; - } - - /* do input and output overlap? */ - if( aSrc>=aDest && aSrc=aSrc && aDest0) { - *aDestSize = doWriteReverse(aSrc, aSrcLength, aDest, aOptions); - } - return NS_OK; -} -#endif // FULL_BIDI_ENGINE diff --git a/layout/base/nsBidi.h b/layout/base/nsBidi.h index 391c7c32bc..dee1f3cea6 100644 --- a/layout/base/nsBidi.h +++ b/layout/base/nsBidi.h @@ -49,14 +49,6 @@ * It holds an embedding level and indicates the visual direction * by its bit 0 (even/odd value).

* - * It can also hold non-level values for the - * aParaLevel and aEmbeddingLevels - * arguments of SetPara; there: - *

    - *
  • bit 7 of an aEmbeddingLevels[] - * value indicates whether the using application is - * specifying the level of a character to override whatever the - * Bidi implementation would resolve it to.
  • *
  • aParaLevel can be set to the * pseudo-level values NSBIDI_DEFAULT_LTR * and NSBIDI_DEFAULT_RTL.
@@ -127,64 +119,28 @@ enum nsBidiDirection { NSBIDI_MIXED }; -typedef enum nsBidiDirection nsBidiDirection; - /* miscellaneous definitions ------------------------------------------------ */ -/** option flags for WriteReverse() */ -/** - * option bit for WriteReverse(): - * keep combining characters after their base characters in RTL runs - * - * @see WriteReverse - */ -#define NSBIDI_KEEP_BASE_COMBINING 1 - -/** - * option bit for WriteReverse(): - * replace characters with the "mirrored" property in RTL runs - * by their mirror-image mappings - * - * @see WriteReverse - */ -#define NSBIDI_DO_MIRRORING 2 - -/** - * option bit for WriteReverse(): - * remove Bidi control characters - * - * @see WriteReverse - */ -#define NSBIDI_REMOVE_BIDI_CONTROLS 8 /* helper macros for each allocated array member */ -#define GETDIRPROPSMEMORY(length) \ - GetMemory((void **)&mDirPropsMemory, &mDirPropsSize, \ - mMayAllocateText, (length)) +#define GETDIRPROPSMEMORY(length) nsBidi::GetMemory((void **)&mDirPropsMemory, \ + &mDirPropsSize, \ + (length)) -#define GETLEVELSMEMORY(length) \ - GetMemory((void **)&mLevelsMemory, &mLevelsSize, \ - mMayAllocateText, (length)) +#define GETLEVELSMEMORY(length) nsBidi::GetMemory((void **)&mLevelsMemory, \ + &mLevelsSize, \ + (length)) -#define GETRUNSMEMORY(length) \ - GetMemory((void **)&mRunsMemory, &mRunsSize, \ - mMayAllocateRuns, (length)*sizeof(Run)) +#define GETRUNSMEMORY(length) nsBidi::GetMemory((void **)&mRunsMemory, \ + &mRunsSize, \ + (length)*sizeof(Run)) -/* additional macros used by constructor - always allow allocation */ -#define GETINITIALDIRPROPSMEMORY(length) \ - GetMemory((void **)&mDirPropsMemory, &mDirPropsSize, \ - true, (length)) +#define GETISOLATESMEMORY(length) nsBidi::GetMemory((void **)&mIsolatesMemory, \ + &mIsolatesSize, \ + (length)*sizeof(Isolate)) -#define GETINITIALLEVELSMEMORY(length) \ - GetMemory((void **)&mLevelsMemory, &mLevelsSize, \ - true, (length)) - -#define GETINITIALRUNSMEMORY(length) \ - GetMemory((void **)&mRunsMemory, &mRunsSize, \ - true, (length)*sizeof(Run)) - -#define GETINITIALISOLATESMEMORY(length) \ - GetMemory((void **)&mIsolatesMemory, &mIsolatesSize, \ - true, (length)*sizeof(Isolate)) +#define GETOPENINGSMEMORY(length) nsBidi::GetMemory((void **)&mOpeningsMemory, \ + &mOpeningsSize, \ + (length)*sizeof(Opening)) /* * Sometimes, bit values are more appropriate @@ -233,15 +189,6 @@ typedef uint8_t DirProp; #define IS_DEFAULT_LEVEL(level) (((level)&0xfe)==0xfe) -/* - * The following bit is ORed to the property of directional control - * characters which are ignored: unmatched PDF or PDI; LRx, RLx or FSI - * which would exceed the maximum explicit bidi level. - */ -#define IGNORE_CC 0x40 - -#define PURE_DIRPROP(prop) ((prop)&~IGNORE_CC) - /* * The following bit is used for the directional isolate status. * Stack entries corresponding to isolate sequences are greater than ISOLATE. @@ -251,6 +198,9 @@ typedef uint8_t DirProp; /* number of isolate entries allocated initially without malloc */ #define SIMPLE_ISOLATES_SIZE 5 +/* number of isolate run entries for paired brackets allocated initially without malloc */ +#define SIMPLE_OPENINGS_COUNT 8 + /* handle surrogate pairs --------------------------------------------------- */ #define IS_FIRST_SURROGATE(uchar) (((uchar)&0xfc00)==0xd800) @@ -390,6 +340,32 @@ struct Isolate { int16_t state; }; +// For bracket matching + +#define FOUND_L DIRPROP_FLAG(L) +#define FOUND_R DIRPROP_FLAG(R) + +struct Opening { + int32_t position; /* position of opening bracket */ + int32_t match; /* matching char or -position of closing bracket */ + int32_t contextPos; /* position of last strong char found before opening */ + uint16_t flags; /* bits for L or R/AL found within the pair */ + DirProp contextDir; /* L or R according to last strong char before opening */ + uint8_t filler; /* to complete a nice multiple of 4 chars */ +}; + +struct IsoRun { + int32_t contextPos; /* position of char determining context */ + uint16_t start; /* index of first opening entry for this run */ + uint16_t limit; /* index after last opening entry for this run */ + nsBidiLevel level; /* level of this run */ + DirProp lastStrong; /* bidi class of last strong char found in this run */ + DirProp lastBase; /* bidi class of last base char found in this run */ + DirProp contextDir; /* L or R to use as context for following openings */ +}; + +class nsBidi; + /* Run structure for reordering --------------------------------------------- */ typedef struct Run { @@ -505,28 +481,8 @@ public: * the desired default is used (0 for LTR or 1 for RTL). * Any other value between 0 and NSBIDI_MAX_EXPLICIT_LEVEL is also valid, * with odd levels indicating RTL. - * - * @param aEmbeddingLevels (in) may be used to preset the embedding and override levels, - * ignoring characters like LRE and PDF in the text. - * A level overrides the directional property of its corresponding - * (same index) character if the level has the - * NSBIDI_LEVEL_OVERRIDE bit set.

- * Except for that bit, it must be - * aParaLevel<=aEmbeddingLevels[]<=NSBIDI_MAX_EXPLICIT_LEVEL.

- * Caution: A copy of this pointer, not of the levels, - * will be stored in the nsBidi object; - * the aEmbeddingLevels array must not be - * deallocated before the nsBidi object is destroyed or reused, - * and the aEmbeddingLevels - * should not be modified to avoid unexpected results on subsequent Bidi operations. - * However, the SetPara and - * SetLine functions may modify some or all of the levels.

- * After the nsBidi object is reused or destroyed, the caller - * must take care of the deallocation of the aEmbeddingLevels array.

- * The aEmbeddingLevels array must be - * at least aLength long. */ - nsresult SetPara(const char16_t *aText, int32_t aLength, nsBidiLevel aParaLevel, nsBidiLevel *aEmbeddingLevels); + nsresult SetPara(const char16_t *aText, int32_t aLength, nsBidiLevel aParaLevel); /** * Get the directionality of the text. @@ -548,73 +504,6 @@ public: */ nsresult GetParaLevel(nsBidiLevel* aParaLevel); -#ifdef FULL_BIDI_ENGINE - /** - * SetLine sets an nsBidi to - * contain the reordering information, especially the resolved levels, - * for all the characters in a line of text. This line of text is - * specified by referring to an nsBidi object representing - * this information for a paragraph of text, and by specifying - * a range of indexes in this paragraph.

- * In the new line object, the indexes will range from 0 to aLimit-aStart.

- * - * This is used after calling SetPara - * for a paragraph, and after line-breaking on that paragraph. - * It is not necessary if the paragraph is treated as a single line.

- * - * After line-breaking, rules (L1) and (L2) for the treatment of - * trailing WS and for reordering are performed on - * an nsBidi object that represents a line.

- * - * Important: the line nsBidi object shares data with - * aParaBidi. - * You must destroy or reuse this object before aParaBidi. - * In other words, you must destroy or reuse the nsBidi object for a line - * before the object for its parent paragraph. - * - * @param aParaBidi is the parent paragraph object. - * - * @param aStart is the line's first index into the paragraph text. - * - * @param aLimit is just behind the line's last index into the paragraph text - * (its last index +1).
- * It must be 0<=aStart<=aLimit<=paragraph length. - * - * @see SetPara - */ - nsresult SetLine(const nsBidi* aParaBidi, int32_t aStart, int32_t aLimit); - - /** - * Get the length of the text. - * - * @param aLength receives the length of the text that the nsBidi object was created for. - */ - nsresult GetLength(int32_t* aLength); - - /** - * Get the level for one character. - * - * @param aCharIndex the index of a character. - * - * @param aLevel receives the level for the character at aCharIndex. - * - * @see nsBidiLevel - */ - nsresult GetLevelAt(int32_t aCharIndex, nsBidiLevel* aLevel); - - /** - * Get an array of levels for each character.

- * - * Note that this function may allocate memory under some - * circumstances, unlike GetLevelAt. - * - * @param aLevels receives a pointer to the levels array for the text, - * or nullptr if an error occurs. - * - * @see nsBidiLevel - */ - nsresult GetLevels(nsBidiLevel** aLevels); -#endif // FULL_BIDI_ENGINE /** * Get the bidirectional type for one character. * @@ -707,92 +596,6 @@ public: */ nsresult GetVisualRun(int32_t aRunIndex, int32_t* aLogicalStart, int32_t* aLength, nsBidiDirection* aDirection); -#ifdef FULL_BIDI_ENGINE - /** - * Get the visual position from a logical text position. - * If such a mapping is used many times on the same - * nsBidi object, then calling - * GetLogicalMap is more efficient.

- * - * Note that in right-to-left runs, this mapping places - * modifier letters before base characters and second surrogates - * before first ones. - * - * @param aLogicalIndex is the index of a character in the text. - * - * @param aVisualIndex will receive the visual position of this character. - * - * @see GetLogicalMap - * @see GetLogicalIndex - */ - nsresult GetVisualIndex(int32_t aLogicalIndex, int32_t* aVisualIndex); - - /** - * Get the logical text position from a visual position. - * If such a mapping is used many times on the same - * nsBidi object, then calling - * GetVisualMap is more efficient.

- * - * This is the inverse function to GetVisualIndex. - * - * @param aVisualIndex is the visual position of a character. - * - * @param aLogicalIndex will receive the index of this character in the text. - * - * @see GetVisualMap - * @see GetVisualIndex - */ - nsresult GetLogicalIndex(int32_t aVisualIndex, int32_t* aLogicalIndex); - - /** - * Get a logical-to-visual index map (array) for the characters in the nsBidi - * (paragraph or line) object. - * - * @param aIndexMap is a pointer to an array of GetLength - * indexes which will reflect the reordering of the characters. - * The array does not need to be initialized.

- * The index map will result in aIndexMap[aLogicalIndex]==aVisualIndex.

- * - * @see GetVisualMap - * @see GetVisualIndex - */ - nsresult GetLogicalMap(int32_t *aIndexMap); - - /** - * Get a visual-to-logical index map (array) for the characters in the nsBidi - * (paragraph or line) object. - * - * @param aIndexMap is a pointer to an array of GetLength - * indexes which will reflect the reordering of the characters. - * The array does not need to be initialized.

- * The index map will result in aIndexMap[aVisualIndex]==aLogicalIndex.

- * - * @see GetLogicalMap - * @see GetLogicalIndex - */ - nsresult GetVisualMap(int32_t *aIndexMap); - - /** - * This is a convenience function that does not use a nsBidi object. - * It is intended to be used for when an application has determined the levels - * of objects (character sequences) and just needs to have them reordered (L2). - * This is equivalent to using GetLogicalMap on a - * nsBidi object. - * - * @param aLevels is an array with aLength levels that have been determined by - * the application. - * - * @param aLength is the number of levels in the array, or, semantically, - * the number of objects to be reordered. - * It must be aLength>0. - * - * @param aIndexMap is a pointer to an array of aLength - * indexes which will reflect the reordering of the characters. - * The array does not need to be initialized.

- * The index map will result in aIndexMap[aLogicalIndex]==aVisualIndex. - */ - static nsresult ReorderLogical(const nsBidiLevel *aLevels, int32_t aLength, int32_t *aIndexMap); -#endif // FULL_BIDI_ENGINE /** * This is a convenience function that does not use a nsBidi object. * It is intended to be used for when an application has determined the levels @@ -814,22 +617,6 @@ public: */ static nsresult ReorderVisual(const nsBidiLevel *aLevels, int32_t aLength, int32_t *aIndexMap); -#ifdef FULL_BIDI_ENGINE - /** - * Invert an index map. - * The one-to-one index mapping of the first map is inverted and written to - * the second one. - * - * @param aSrcMap is an array with aLength indexes - * which define the original mapping. - * - * @param aDestMap is an array with aLength indexes - * which will be filled with the inverse mapping. - * - * @param aLength is the length of each array. - */ - nsresult InvertMap(const int32_t *aSrcMap, int32_t *aDestMap, int32_t aLength); -#endif // FULL_BIDI_ENGINE /** * Reverse a Right-To-Left run of Unicode text. * @@ -870,6 +657,45 @@ public: protected: friend class nsBidiPresUtils; + class BracketData { + public: + explicit BracketData(const nsBidi* aBidi); + ~BracketData(); + + void ProcessBoundary(int32_t aLastDirControlCharPos, + nsBidiLevel aContextLevel, + nsBidiLevel aEmbeddingLevel, + const DirProp* aDirProps); + void ProcessLRI_RLI(nsBidiLevel aLevel); + void ProcessPDI(); + bool AddOpening(char16_t aMatch, int32_t aPosition); + void FixN0c(int32_t aOpeningIndex, int32_t aNewPropPosition, + DirProp aNewProp, DirProp* aDirProps); + DirProp ProcessClosing(int32_t aOpenIdx, int32_t aPosition, + DirProp* aDirProps); + bool ProcessChar(int32_t aPosition, char16_t aCh, DirProp* aDirProps, + nsBidiLevel* aLevels); + + private: + // array of opening entries which should be enough in most cases; + // no malloc() needed + Opening mSimpleOpenings[SIMPLE_OPENINGS_COUNT]; + Opening* mOpenings; // pointer to current array of entries, + // either mSimpleOpenings or malloced array + + Opening* mOpeningsMemory; + size_t mOpeningsSize; + + // array of nested isolated sequence entries; can never exceed + // UBIDI_MAX_EXPLICIT_LEVEL + // + 1 for index 0 + // + 1 for before the first isolated sequence + IsoRun mIsoRuns[NSBIDI_MAX_EXPLICIT_LEVEL+2]; + int32_t mIsoRunLast; // index of last used entry in mIsoRuns + + int32_t mOpeningsCount; // number of allocated entries in mOpenings + }; + /** length of the current text */ int32_t mLength; @@ -883,9 +709,6 @@ protected: Run* mRunsMemory; Isolate* mIsolatesMemory; - /** indicators for whether memory may be allocated after construction */ - bool mMayAllocateText, mMayAllocateRuns; - DirProp* mDirProps; nsBidiLevel* mLevels; @@ -924,15 +747,13 @@ private: void Init(); - bool GetMemory(void **aMemory, size_t* aSize, bool aMayAllocate, size_t aSizeNeeded); + static bool GetMemory(void **aMemory, size_t* aSize, size_t aSizeNeeded); void Free(); void GetDirProps(const char16_t *aText); - void ResolveExplicitLevels(nsBidiDirection *aDirection); - - nsresult CheckExplicitLevels(nsBidiDirection *aDirection); + void ResolveExplicitLevels(nsBidiDirection *aDirection, const char16_t *aText); nsBidiDirection DirectionFromFlags(Flags aFlags); @@ -951,10 +772,6 @@ private: void ReorderLine(nsBidiLevel aMinLevel, nsBidiLevel aMaxLevel); static bool PrepareReorder(const nsBidiLevel *aLevels, int32_t aLength, int32_t *aIndexMap, nsBidiLevel *aMinLevel, nsBidiLevel *aMaxLevel); - - int32_t doWriteReverse(const char16_t *src, int32_t srcLength, - char16_t *dest, uint16_t options); - }; #endif // _nsBidi_h_ diff --git a/layout/base/nsBidiPresUtils.cpp b/layout/base/nsBidiPresUtils.cpp index 4d87ce48c9..cc983b1447 100644 --- a/layout/base/nsBidiPresUtils.cpp +++ b/layout/base/nsBidiPresUtils.cpp @@ -208,7 +208,7 @@ struct BidiParagraphData { nsresult SetPara() { return mBidiEngine->SetPara(mBuffer.get(), BufferLength(), - mParaLevel, nullptr); + mParaLevel); } /** @@ -1031,7 +1031,7 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame, if (frame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) { if (!(frame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) { nsContainerFrame* c = static_cast(frame); - MOZ_ASSERT(c = do_QueryFrame(frame), + MOZ_ASSERT(c == do_QueryFrame(frame), "eBidiInlineContainer must be a nsContainerFrame subclass"); c->DrainSelfOverflowList(); } @@ -1261,8 +1261,14 @@ nsBidiPresUtils::ReorderFrames(nsIFrame* aFirstFrameOnLine, const nsSize& aContainerSize, nscoord aStart) { + nsSize containerSize(aContainerSize); + // If this line consists of a line frame, reorder the line frame's children. if (aFirstFrameOnLine->GetType() == nsGkAtoms::lineFrame) { + // The line frame is positioned at the start-edge, so use its size + // as the container size. + containerSize = aFirstFrameOnLine->GetSize(); + aFirstFrameOnLine = aFirstFrameOnLine->GetFirstPrincipalChild(); if (!aFirstFrameOnLine) { return 0; @@ -1274,7 +1280,7 @@ nsBidiPresUtils::ReorderFrames(nsIFrame* aFirstFrameOnLine, BidiLineData bld(aFirstFrameOnLine, aNumFramesOnLine); return RepositionInlineFrames(&bld, aFirstFrameOnLine, aLineWM, - aContainerSize, aStart); + containerSize, aStart); } nsIFrame* @@ -1571,19 +1577,22 @@ nsBidiPresUtils::RepositionFrame(nsIFrame* aFrame, // Since the visual order of frame could be different from the // continuation order, we need to remove any border/padding first, // so that we can get the correct isize of the current frame. - if (!aFrame->GetPrevContinuation()) { - frameISize -= borderPadding.IStart(frameWM); - } - if (!aFrame->GetNextContinuation()) { - frameISize -= borderPadding.IEnd(frameWM); - } - if (!isFirst) { - frameMargin.IStart(frameWM) = 0; - borderPadding.IStart(frameWM) = 0; - } - if (!isLast) { - frameMargin.IEnd(frameWM) = 0; - borderPadding.IEnd(frameWM) = 0; + if (aFrame->StyleBorder()->mBoxDecorationBreak == + NS_STYLE_BOX_DECORATION_BREAK_SLICE) { + if (!aFrame->GetPrevContinuation()) { + frameISize -= borderPadding.IStart(frameWM); + } + if (!aFrame->GetNextContinuation()) { + frameISize -= borderPadding.IEnd(frameWM); + } + if (!isFirst) { + frameMargin.IStart(frameWM) = 0; + borderPadding.IStart(frameWM) = 0; + } + if (!isLast) { + frameMargin.IEnd(frameWM) = 0; + borderPadding.IEnd(frameWM) = 0; + } } frameISize += borderPadding.IStartEnd(frameWM); @@ -2006,8 +2015,10 @@ nsresult nsBidiPresUtils::ProcessText(const char16_t* aText, int32_t runCount; nsAutoString textBuffer(aText, aLength); + textBuffer.ReplaceChar(kSeparators, kSpace); + const char16_t* text = textBuffer.get(); - nsresult rv = aBidiEngine->SetPara(aText, aLength, aBaseLevel, nullptr); + nsresult rv = aBidiEngine->SetPara(text, aLength, aBaseLevel); if (NS_FAILED(rv)) return rv; @@ -2061,7 +2072,7 @@ nsresult nsBidiPresUtils::ProcessText(const char16_t* aText, */ if (dir == NSBIDI_RTL) { - aprocessor.SetText(aText + start, subRunLength, dir); + aprocessor.SetText(text + start, subRunLength, dir); width = aprocessor.GetWidth(); xOffset += width; xEndRun = xOffset; @@ -2070,10 +2081,10 @@ nsresult nsBidiPresUtils::ProcessText(const char16_t* aText, while (subRunCount > 0) { // CalculateCharType can increment subRunCount if the run // contains mixed character types - CalculateCharType(aBidiEngine, aText, lineOffset, typeLimit, subRunLimit, subRunLength, subRunCount, charType, prevType); + CalculateCharType(aBidiEngine, text, lineOffset, typeLimit, subRunLimit, subRunLength, subRunCount, charType, prevType); nsAutoString runVisualText; - runVisualText.Assign(aText + start, subRunLength); + runVisualText.Assign(text + start, subRunLength); if (int32_t(runVisualText.Length()) < subRunLength) return NS_ERROR_OUT_OF_MEMORY; FormatUnicodeText(aPresContext, runVisualText.BeginWriting(), @@ -2157,14 +2168,14 @@ nsresult nsBidiPresUtils::ProcessText(const char16_t* aText, // One day, son, this could all be replaced with mBidiEngine.GetVisualIndex ... posResolve->visualIndex = visualStart + (subRunLength - (posResolve->logicalIndex + 1 - start)); // Skipping to the "left part". - visualLeftPart = aText + posResolve->logicalIndex + 1; + visualLeftPart = text + posResolve->logicalIndex + 1; // Skipping to the right side of the current character visualRightSide = visualLeftPart - 1; } else { posResolve->visualIndex = visualStart + (posResolve->logicalIndex - start); // Skipping to the "left part". - visualLeftPart = aText + start; + visualLeftPart = text + start; // In LTR mode this is the same as visualLeftPart visualRightSide = visualLeftPart; } @@ -2280,125 +2291,6 @@ nsresult nsBidiPresUtils::ProcessTextForRenderingContext(const char16_t* a aMode, aPosResolve, aPosResolveCount, aWidth, &bidiEngine); } -/* static */ -void nsBidiPresUtils::WriteReverse(const char16_t* aSrc, - uint32_t aSrcLength, - char16_t* aDest) -{ - char16_t* dest = aDest + aSrcLength; - mozilla::unicode::ClusterIterator iter(aSrc, aSrcLength); - - while (!iter.AtEnd()) { - iter.Next(); - for (const char16_t *cp = iter; cp > aSrc; ) { - // Here we rely on the fact that there are no non-BMP mirrored pairs - // currently in Unicode, so we don't need to look for surrogates - *--dest = mozilla::unicode::GetMirroredChar(*--cp); - } - aSrc = iter; - } - - NS_ASSERTION(dest == aDest, "Whole string not copied"); -} - -/* static */ -bool nsBidiPresUtils::WriteLogicalToVisual(const char16_t* aSrc, - uint32_t aSrcLength, - char16_t* aDest, - nsBidiLevel aBaseDirection, - nsBidi* aBidiEngine) -{ - const char16_t* src = aSrc; - nsresult rv = aBidiEngine->SetPara(src, aSrcLength, aBaseDirection, nullptr); - if (NS_FAILED(rv)) { - return false; - } - - nsBidiDirection dir; - rv = aBidiEngine->GetDirection(&dir); - // NSBIDI_LTR returned from GetDirection means the whole text is LTR - if (NS_FAILED(rv) || dir == NSBIDI_LTR) { - return false; - } - - int32_t runCount; - rv = aBidiEngine->CountRuns(&runCount); - if (NS_FAILED(rv)) { - return false; - } - - int32_t runIndex, start, length; - char16_t* dest = aDest; - - for (runIndex = 0; runIndex < runCount; ++runIndex) { - rv = aBidiEngine->GetVisualRun(runIndex, &start, &length, &dir); - if (NS_FAILED(rv)) { - return false; - } - - src = aSrc + start; - - if (dir == NSBIDI_RTL) { - WriteReverse(src, length, dest); - dest += length; - } else { - do { - NS_ASSERTION(src >= aSrc && src < aSrc + aSrcLength, - "logical index out of range"); - NS_ASSERTION(dest < aDest + aSrcLength, "visual index out of range"); - *(dest++) = *(src++); - } while (--length); - } - } - - NS_ASSERTION(static_cast(dest - aDest) == aSrcLength, - "whole string not copied"); - return true; -} - -void nsBidiPresUtils::CopyLogicalToVisual(const nsAString& aSource, - nsAString& aDest, - nsBidiLevel aBaseDirection, - bool aOverride) -{ - aDest.SetLength(0); - uint32_t srcLength = aSource.Length(); - if (srcLength == 0) - return; - if (!aDest.SetLength(srcLength, fallible)) { - return; - } - nsAString::const_iterator fromBegin, fromEnd; - nsAString::iterator toBegin; - aSource.BeginReading(fromBegin); - aSource.EndReading(fromEnd); - aDest.BeginWriting(toBegin); - - if (aOverride) { - if (aBaseDirection == NSBIDI_RTL) { - // no need to use the converter -- just copy the string in reverse order - WriteReverse(fromBegin.get(), srcLength, toBegin.get()); - } else { - // if aOverride && aBaseDirection == NSBIDI_LTR, fall through to the - // simple copy - aDest.SetLength(0); - } - } else { - nsBidi bidiEngine; - if (!WriteLogicalToVisual(fromBegin.get(), srcLength, toBegin.get(), - aBaseDirection, &bidiEngine)) { - aDest.SetLength(0); - } - } - - if (aDest.IsEmpty()) { - // Either there was an error or the source is unidirectional - // left-to-right. In either case, just copy source to dest. - CopyUnicodeTo(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd), - aDest); - } -} - /* static */ nsBidiLevel nsBidiPresUtils::BidiLevelFromStyle(nsStyleContext* aStyleContext) diff --git a/layout/base/nsBidiPresUtils.h b/layout/base/nsBidiPresUtils.h index 67ceb16910..2c8b4677b9 100644 --- a/layout/base/nsBidiPresUtils.h +++ b/layout/base/nsBidiPresUtils.h @@ -356,24 +356,6 @@ public: nscoord* aWidth, nsBidi* aBidiEngine); - /** - * Make a copy of a string, converting from logical to visual order - * - * @param aSource the source string - * @param aDest the destination string - * @param aBaseDirection the base direction of the string - * (NSBIDI_LTR or NSBIDI_RTL to force the base direction; - * NSBIDI_DEFAULT_LTR or NSBIDI_DEFAULT_RTL to let the bidi engine - * determine the direction from rules P2 and P3 of the bidi algorithm. - * @see nsBidi::GetPara - * @param aOverride if TRUE, the text has a bidi override, according to - * the direction in aDir - */ - static void CopyLogicalToVisual(const nsAString& aSource, - nsAString& aDest, - nsBidiLevel aBaseDirection, - bool aOverride); - /** * Use style attributes to determine the base paragraph level to pass to the * bidi algorithm. @@ -568,16 +550,6 @@ private: static void StripBidiControlCharacters(char16_t* aText, int32_t& aTextLength); - - static bool WriteLogicalToVisual(const char16_t* aSrc, - uint32_t aSrcLength, - char16_t* aDest, - nsBidiLevel aBaseDirection, - nsBidi* aBidiEngine); - - static void WriteReverse(const char16_t* aSrc, - uint32_t aSrcLength, - char16_t* aDest); }; #endif /* nsBidiPresUtils_h___ */ diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 31ed8a2512..b5cc15dc7c 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -10329,18 +10329,26 @@ nsCSSFrameConstructor::WrapItemsInPseudoParent(nsIContent* aParentContent, wrapperStyle, true, nullptr); + const nsStyleDisplay* disp = newItem->mStyleContext->StyleDisplay(); // Here we're cheating a tad... technically, table-internal items should be // inline if aParentFrame is inline, but they'll get wrapped in an // inline-table in the end, so it'll all work out. In any case, arguably // we don't need to maintain this state at this point... but it's better // to, I guess. newItem->mIsAllInline = newItem->mHasInlineEnds = - newItem->mStyleContext->StyleDisplay()->IsInlineOutsideStyle(); + disp->IsInlineOutsideStyle(); - // Table pseudo frames always induce line boundaries around their - // contents. - newItem->mChildItems.SetLineBoundaryAtStart(true); - newItem->mChildItems.SetLineBoundaryAtEnd(true); + bool isRuby = disp->IsRubyDisplayType(); + // All types of ruby frames need a block frame to provide line layout, + // hence they are always line participant. + newItem->mIsLineParticipant = isRuby; + + if (!isRuby) { + // Table pseudo frames always induce line boundaries around their + // contents. + newItem->mChildItems.SetLineBoundaryAtStart(true); + newItem->mChildItems.SetLineBoundaryAtEnd(true); + } // The parent of the items in aItems is also the parent of the items // in mChildItems newItem->mChildItems.SetParentHasNoXBLChildren( diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index 203a993137..a86d2c06a9 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -1381,8 +1381,9 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext, shadowContext->SetMatrix( shadowContext->CurrentMatrix().Translate(devPixelOffset)); - nsRect nativeRect; - nativeRect.IntersectRect(frameRect, aDirtyRect); + nsRect nativeRect = aDirtyRect; + nativeRect.MoveBy(-nsPoint(shadowItem->mXOffset, shadowItem->mYOffset)); + nativeRect.IntersectRect(frameRect, nativeRect); nsRenderingContext wrapperCtx(shadowContext); aPresContext->GetTheme()->DrawWidgetBackground(&wrapperCtx, aForFrame, styleDisplay->mAppearance, aFrameArea, nativeRect); @@ -2688,6 +2689,7 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext, // to the right edge of a tile, then we can repeat by just repeating the // gradient. if (!cellContainsFill && + stopDelta != 0.0 && // if 0.0, gradientStopEnd is bogus (see above) ((gradientStopStart.y == gradientStopEnd.y && gradientStopStart.x == 0 && gradientStopEnd.x == srcSize.width) || (gradientStopStart.x == gradientStopEnd.x && gradientStopStart.y == 0 && diff --git a/layout/base/nsCSSRenderingBorders.cpp b/layout/base/nsCSSRenderingBorders.cpp index d411d6adbd..13b91ae785 100644 --- a/layout/base/nsCSSRenderingBorders.cpp +++ b/layout/base/nsCSSRenderingBorders.cpp @@ -1176,11 +1176,8 @@ ComputeCornerSkirtSize(Float aAlpha1, Float aAlpha2, // Draws a border radius with possibly different sides. // A skirt is drawn underneath the corner intersection to hide possible // seams when anti-aliased drawing is used. -// As an optimization, this tries to combine the drawing of the side itself -// with the drawing of the border radius where possible. static void DrawBorderRadius(DrawTarget* aDrawTarget, - const Point& aSideStart, Float aSideWidth, mozilla::css::Corner c, const Point& aOuterCorner, const Point& aInnerCorner, const twoFloats& aCornerMultPrev, const twoFloats& aCornerMultNext, @@ -1221,14 +1218,7 @@ DrawBorderRadius(DrawTarget* aDrawTarget, if (aFirstColor.a > 0) { builder = aDrawTarget->CreatePathBuilder(); - // Combine stroke with corner if color matches. - if (aSideWidth > 0) { - builder->MoveTo(aSideStart + aCornerMultNext * aSideWidth); - builder->LineTo(aSideStart); - builder->LineTo(outerCornerStart); - } else { - builder->MoveTo(outerCornerStart); - } + builder->MoveTo(outerCornerStart); } if (aFirstColor != aSecondColor) { @@ -1308,11 +1298,8 @@ DrawBorderRadius(DrawTarget* aDrawTarget, // Draw a corner with possibly different sides. // A skirt is drawn underneath the corner intersection to hide possible // seams when anti-aliased drawing is used. -// As an optimization, this tries to combine the drawing of the side itself -// with the drawing of the corner where possible. static void DrawCorner(DrawTarget* aDrawTarget, - const Point& aSideStart, Float aSideWidth, mozilla::css::Corner c, const Point& aOuterCorner, const Point& aInnerCorner, const twoFloats& aCornerMultPrev, const twoFloats& aCornerMultNext, @@ -1330,13 +1317,7 @@ DrawCorner(DrawTarget* aDrawTarget, if (aFirstColor.a > 0) { builder = aDrawTarget->CreatePathBuilder(); - // Combine stroke with corner if color matches. - if (aSideWidth > 0) { - builder->MoveTo(aSideStart + aCornerMultNext * aSideWidth); - builder->LineTo(aSideStart); - } else { - builder->MoveTo(cornerStart); - } + builder->MoveTo(cornerStart); } if (aFirstColor != aSecondColor) { @@ -1398,8 +1379,8 @@ nsCSSBorderRenderer::DrawNoCompositeColorSolidBorder() NS_FOR_CSS_SIDES(i) { // We now draw the current side and the CW corner following it. // The CCW corner of this side was already drawn in the previous iteration. - // The side will either be drawn as an explicit stroke or combined - // with the drawing of the CW corner. + // The side will be drawn as an explicit stroke, and the CW corner will be + // filled separately. // If the next side does not have a matching color, then we split the // corner into two halves, one of each side's color and draw both. // Thus, the CCW corner of the next side will end up drawn here. @@ -1443,9 +1424,13 @@ nsCSSBorderRenderer::DrawNoCompositeColorSolidBorder() mOuterRect.AtCorner(prevCorner) + cornerMults[i2] * mBorderCornerDimensions[prevCorner]; Point sideEnd = outerCorner + cornerMults[i] * mBorderCornerDimensions[c]; - // if the side is inverted, don't draw it - if (-(sideEnd - sideStart).DotProduct(cornerMults[i]) <= 0) { - sideWidth = 0.0f; + // check if the side is visible and not inverted + if (sideWidth > 0 && firstColor.a > 0 && + -(sideEnd - sideStart).DotProduct(cornerMults[i]) > 0) { + mDrawTarget->StrokeLine(sideStart + centerAdjusts[i] * sideWidth, + sideEnd + centerAdjusts[i] * sideWidth, + ColorPattern(firstColor), + StrokeOptions(sideWidth)); } Float skirtSize = 0.0f, skirtSlope = 0.0f; @@ -1462,7 +1447,6 @@ nsCSSBorderRenderer::DrawNoCompositeColorSolidBorder() if (!mBorderRadii[c].IsEmpty()) { // the corner has a border radius DrawBorderRadius(mDrawTarget, - sideStart, sideWidth, c, outerCorner, innerCorner, cornerMults[i], cornerMults[i3], mBorderCornerDimensions[c], @@ -1471,17 +1455,10 @@ nsCSSBorderRenderer::DrawNoCompositeColorSolidBorder() } else if (!mBorderCornerDimensions[c].IsEmpty()) { // a corner with no border radius DrawCorner(mDrawTarget, - sideStart, sideWidth, c, outerCorner, innerCorner, cornerMults[i], cornerMults[i3], mBorderCornerDimensions[c], firstColor, secondColor, skirtSize, skirtSlope); - } else if (sideWidth > 0 && firstColor.a > 0) { - // if there is no corner, then stroke the border side separately - mDrawTarget->StrokeLine(sideStart + centerAdjusts[i] * sideWidth, - sideEnd + centerAdjusts[i] * sideWidth, - ColorPattern(firstColor), - StrokeOptions(sideWidth)); } } } diff --git a/layout/base/nsChangeHint.h b/layout/base/nsChangeHint.h index c015013fac..dc527c80ba 100644 --- a/layout/base/nsChangeHint.h +++ b/layout/base/nsChangeHint.h @@ -20,31 +20,31 @@ enum nsChangeHint { // change was visual only (e.g., COLOR=) // Invalidates all descendant frames (including following // placeholders to out-of-flow frames). - nsChangeHint_RepaintFrame = 0x01, + nsChangeHint_RepaintFrame = 1 << 0, // For reflow, we want flags to give us arbitrary FrameNeedsReflow behavior. // just do a FrameNeedsReflow. - nsChangeHint_NeedReflow = 0x02, + nsChangeHint_NeedReflow = 1 << 1, // Invalidate intrinsic widths on the frame's ancestors. Must not be set // without setting nsChangeHint_NeedReflow. - nsChangeHint_ClearAncestorIntrinsics = 0x04, + nsChangeHint_ClearAncestorIntrinsics = 1 << 2, // Invalidate intrinsic widths on the frame's descendants. Must not be set // without also setting nsChangeHint_ClearAncestorIntrinsics. - nsChangeHint_ClearDescendantIntrinsics = 0x08, + nsChangeHint_ClearDescendantIntrinsics = 1 << 3, // Force unconditional reflow of all descendants. Must not be set without // setting nsChangeHint_NeedReflow, but is independent of both the // Clear*Intrinsics flags. - nsChangeHint_NeedDirtyReflow = 0x10, + nsChangeHint_NeedDirtyReflow = 1 << 4, // change requires view to be updated, if there is one (e.g., clip:). // Updates all descendants (including following placeholders to out-of-flows). - nsChangeHint_SyncFrameView = 0x20, + nsChangeHint_SyncFrameView = 1 << 5, // The currently shown mouse cursor needs to be updated - nsChangeHint_UpdateCursor = 0x40, + nsChangeHint_UpdateCursor = 1 << 6, /** * Used when the computed value (a URI) of one or more of an element's @@ -54,38 +54,38 @@ enum nsChangeHint { * hint results in nsSVGEffects::UpdateEffects being called on the element's * frame. */ - nsChangeHint_UpdateEffects = 0x80, + nsChangeHint_UpdateEffects = 1 << 7, /** * Visual change only, but the change can be handled entirely by * updating the layer(s) for the frame. * Updates all descendants (including following placeholders to out-of-flows). */ - nsChangeHint_UpdateOpacityLayer = 0x100, + nsChangeHint_UpdateOpacityLayer = 1 << 8, /** * Updates all descendants. Any placeholder descendants' out-of-flows * are also descendants of the transformed frame, so they're updated. */ - nsChangeHint_UpdateTransformLayer = 0x200, + nsChangeHint_UpdateTransformLayer = 1 << 9, /** * Change requires frame change (e.g., display:). * This subsumes all the above. Reconstructs all frame descendants, * including following placeholders to out-of-flows. */ - nsChangeHint_ReconstructFrame = 0x400, + nsChangeHint_ReconstructFrame = 1 << 10, /** * The frame's overflow area has changed. Does not update any descendant * frames. */ - nsChangeHint_UpdateOverflow = 0x800, + nsChangeHint_UpdateOverflow = 1 << 11, /** * The overflow area of the frame and all of its descendants has changed. This * can happen through a text-decoration change. */ - nsChangeHint_UpdateSubtreeOverflow = 0x1000, + nsChangeHint_UpdateSubtreeOverflow = 1 << 12, /** * The frame's overflow area has changed, through a change in its transform. @@ -95,7 +95,7 @@ enum nsChangeHint { * changed, see nsChangeHint_UpdateOverflow. * Does not update any descendant frames. */ - nsChangeHint_UpdatePostTransformOverflow = 0x2000, + nsChangeHint_UpdatePostTransformOverflow = 1 << 13, /** * This frame's effect on its parent's overflow area has changed. @@ -103,13 +103,13 @@ enum nsChangeHint { * changed; if those are the case, see * nsChangeHint_UpdatePostTransformOverflow.) */ - nsChangeHint_UpdateParentOverflow = 0x4000, + nsChangeHint_UpdateParentOverflow = 1 << 14, /** * The children-only transform of an SVG frame changed, requiring the * overflow rects of the frame's immediate children to be updated. */ - nsChangeHint_ChildrenOnlyTransform = 0x8000, + nsChangeHint_ChildrenOnlyTransform = 1 << 15, /** * The frame's offsets have changed, while its dimensions might have @@ -121,7 +121,7 @@ enum nsChangeHint { * nsChangeHint_UpdateOverflow in order to get the overflow areas of * the ancestors updated as well. */ - nsChangeHint_RecomputePosition = 0x10000, + nsChangeHint_RecomputePosition = 1 << 16, /** * Behaves like ReconstructFrame, but only if the frame has descendants @@ -129,7 +129,7 @@ enum nsChangeHint { * has changed whether the frame is a container for fixed-pos or abs-pos * elements, but reframing is otherwise not needed. */ - nsChangeHint_UpdateContainingBlock = 0x20000, + nsChangeHint_UpdateContainingBlock = 1 << 17, /** * This change hint has *no* change handling behavior. However, it @@ -137,19 +137,19 @@ enum nsChangeHint { * changes, and it's inherited by a child, that might require a reflow * due to the border-width change on the child. */ - nsChangeHint_BorderStyleNoneChange = 0x40000, + nsChangeHint_BorderStyleNoneChange = 1 << 18, /** * SVG textPath needs to be recomputed because the path has changed. * This means that the glyph positions of the text need to be recomputed. */ - nsChangeHint_UpdateTextPath = 0x80000, + nsChangeHint_UpdateTextPath = 1 << 19, /** * This will schedule an invalidating paint. This is useful if something * has changed which will be invalidated by DLBI. */ - nsChangeHint_SchedulePaint = 0x100000, + nsChangeHint_SchedulePaint = 1 << 20, /** * A hint reflecting that style data changed with no change handling @@ -165,24 +165,24 @@ enum nsChangeHint { * different data would be cached information that would be re-calculated * to the same values, such as nsStyleBorder::mSubImages.) */ - nsChangeHint_NeutralChange = 0x200000, + nsChangeHint_NeutralChange = 1 << 21, /** * This will cause rendering observers to be invalidated. */ - nsChangeHint_InvalidateRenderingObservers = 0x400000, + nsChangeHint_InvalidateRenderingObservers = 1 << 22, /** * Indicates that the reflow changes the size or position of the * element, and thus the reflow must start from at least the frame's * parent. */ - nsChangeHint_ReflowChangesSizeOrPosition = 0x800000, + nsChangeHint_ReflowChangesSizeOrPosition = 1 << 23, /** * Indicates that the style changes the computed BSize --- e.g. 'height'. */ - nsChangeHint_UpdateComputedBSize = 0x1000000, + nsChangeHint_UpdateComputedBSize = 1 << 24, /** * Indicates that the 'opacity' property changed between 1 and non-1. @@ -192,7 +192,7 @@ enum nsChangeHint { * Note that we do not send this hint if the non-1 value was 0.99 or * greater, since in that case we send a RepaintFrame hint instead. */ - nsChangeHint_UpdateUsesOpacity = 0x2000000, + nsChangeHint_UpdateUsesOpacity = 1 << 25, // IMPORTANT NOTE: When adding new hints, consider whether you need to // add them to NS_HintsNotHandledForDescendantsIn() below. Please also @@ -390,42 +390,42 @@ enum nsRestyleHint { // results, update the style contexts of descendants. (Irrelevant if // eRestyle_Subtree is also set, since that implies a superset of the // work.) - eRestyle_Self = (1<<0), + eRestyle_Self = 1 << 0, // Rerun selector matching on descendants of the element that match // a given selector. - eRestyle_SomeDescendants = (1<<1), + eRestyle_SomeDescendants = 1 << 1, // Rerun selector matching on the element and all of its descendants. // (Implies eRestyle_ForceDescendants, which ensures that we continue // the restyling process for all descendants, but doesn't cause // selector matching.) - eRestyle_Subtree = (1<<2), + eRestyle_Subtree = 1 << 2, // Rerun selector matching on all later siblings of the element and // all of their descendants. - eRestyle_LaterSiblings = (1<<3), + eRestyle_LaterSiblings = 1 << 3, // Replace the style data coming from CSS transitions without updating // any other style data. If a new style context results, update style // contexts on the descendants. (Irrelevant if eRestyle_Self or // eRestyle_Subtree is also set, since those imply a superset of the // work.) - eRestyle_CSSTransitions = (1<<4), + eRestyle_CSSTransitions = 1 << 4, // Replace the style data coming from CSS animations without updating // any other style data. If a new style context results, update style // contexts on the descendants. (Irrelevant if eRestyle_Self or // eRestyle_Subtree is also set, since those imply a superset of the // work.) - eRestyle_CSSAnimations = (1<<5), + eRestyle_CSSAnimations = 1 << 5, // Replace the style data coming from SVG animations (SMIL Animations) // without updating any other style data. If a new style context // results, update style contexts on the descendants. (Irrelevant if // eRestyle_Self or eRestyle_Subtree is also set, since those imply a // superset of the work.) - eRestyle_SVGAttrAnimations = (1<<6), + eRestyle_SVGAttrAnimations = 1 << 6, // Replace the style data coming from inline style without updating // any other style data. If a new style context results, update style @@ -436,22 +436,22 @@ enum nsRestyleHint { // eRestyle_Self. // If the change is for the advance of a declarative animation, use // the value below instead. - eRestyle_StyleAttribute = (1<<7), + eRestyle_StyleAttribute = 1 << 7, // Same as eRestyle_StyleAttribute, but for when the change results // from the advance of a declarative animation. - eRestyle_StyleAttribute_Animations = (1<<8), + eRestyle_StyleAttribute_Animations = 1 << 8, // Continue the restyling process to the current frame's children even // if this frame's restyling resulted in no style changes. - eRestyle_Force = (1<<9), + eRestyle_Force = 1 << 9, // Continue the restyling process to all of the current frame's // descendants, even if any frame's restyling resulted in no style // changes. (Implies eRestyle_Force.) Note that this is weaker than // eRestyle_Subtree, which makes us rerun selector matching on all // descendants rather than just continuing the restyling process. - eRestyle_ForceDescendants = (1<<10), + eRestyle_ForceDescendants = 1 << 10, // Useful unions: eRestyle_AllHintsWithAnimations = eRestyle_CSSTransitions | diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 8bb30d6ff9..1b75bc9bd4 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -687,7 +687,7 @@ nsDisplayListBuilder::WrapAGRForFrame(nsIFrame* aAnimatedGeometryRoot, AnimatedGeometryRoot* result = nullptr; if (!mFrameToAnimatedGeometryRootMap.Get(aAnimatedGeometryRoot, &result)) { - MOZ_ASSERT(aAnimatedGeometryRoot != RootReferenceFrame()); + MOZ_ASSERT(nsLayoutUtils::IsAncestorFrameCrossDoc(RootReferenceFrame(), aAnimatedGeometryRoot)); AnimatedGeometryRoot* parent = aParent; if (!parent) { nsIFrame* parentFrame = nsLayoutUtils::GetCrossDocParentFrame(aAnimatedGeometryRoot); @@ -706,7 +706,7 @@ nsDisplayListBuilder::WrapAGRForFrame(nsIFrame* aAnimatedGeometryRoot, AnimatedGeometryRoot* nsDisplayListBuilder::FindAnimatedGeometryRootFor(nsIFrame* aFrame) { - if (!IsForPainting()) { + if (!IsPaintingToWindow()) { return &mRootAGR; } if (aFrame == mCurrentFrame) { @@ -1080,8 +1080,16 @@ IsStickyFrameActive(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsIFrame* bool nsDisplayListBuilder::IsAnimatedGeometryRoot(nsIFrame* aFrame, nsIFrame** aParent) { - if (aFrame == mReferenceFrame) + if (aFrame == mReferenceFrame) { return true; + } + if (!IsPaintingToWindow()) { + if (aParent) { + *aParent = nsLayoutUtils::GetCrossDocParentFrame(aFrame); + } + return false; + } + if (nsLayoutUtils::IsPopup(aFrame)) return true; if (ActiveLayerTracker::IsOffsetOrMarginStyleAnimated(aFrame)) @@ -1134,6 +1142,7 @@ nsDisplayListBuilder::IsAnimatedGeometryRoot(nsIFrame* aFrame, nsIFrame** aParen nsIFrame* nsDisplayListBuilder::FindAnimatedGeometryRootFrameFor(nsIFrame* aFrame) { + MOZ_ASSERT(nsLayoutUtils::IsAncestorFrameCrossDoc(RootReferenceFrame(), aFrame)); nsIFrame* cursor = aFrame; while (cursor != RootReferenceFrame()) { nsIFrame* next; @@ -1880,9 +1889,11 @@ void nsDisplayList::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, if (aState->mInPreserves3D) { // Collect leaves of the current 3D rendering context. for (item = GetBottom(); item; item = item->GetAbove()) { - MOZ_ASSERT(item->GetType() == nsDisplayTransform::TYPE_TRANSFORM); + MOZ_ASSERT(item->GetType() == nsDisplayTransform::TYPE_TRANSFORM || + item->GetType() == nsDisplayTransform::TYPE_PERSPECTIVE); if (item->Frame()->Extend3DContext() && - !static_cast(item)->IsTransformSeparator()) { + (item->GetType() == nsDisplayTransform::TYPE_PERSPECTIVE || + !static_cast(item)->IsTransformSeparator())) { item->HitTest(aBuilder, aRect, aState, aOutFrames); } else { // One of leaves in the current 3D rendering context. @@ -2528,8 +2539,17 @@ nsDisplayBackgroundImage::CanOptimizeToImageLayer(LayerManager* aManager, return false; } - // We currently can't handle tiled or partial backgrounds. - if (!state.mDestArea.IsEqualEdges(state.mFillArea)) { + // We currently can't handle tiled backgrounds. + if (!state.mDestArea.Contains(state.mFillArea)) { + return false; + } + + // For 'contain' and 'cover', we allow any pixel of the image to be sampled + // because there isn't going to be any spriting/atlasing going on. + bool allowPartialImages = + (layer.mSize.mWidthType == nsStyleBackground::Size::eContain || + layer.mSize.mWidthType == nsStyleBackground::Size::eCover); + if (!allowPartialImages && !state.mFillArea.Contains(state.mDestArea)) { return false; } @@ -4893,6 +4913,7 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder, void nsDisplayTransform::SetReferenceFrameToAncestor(nsDisplayListBuilder* aBuilder) { + mAnimatedGeometryRootForChildren = mAnimatedGeometryRoot; if (mFrame == aBuilder->RootReferenceFrame()) { return; } @@ -4900,7 +4921,6 @@ nsDisplayTransform::SetReferenceFrameToAncestor(nsDisplayListBuilder* aBuilder) mReferenceFrame = aBuilder->FindReferenceFrameFor(outerFrame); mToReferenceFrame = mFrame->GetOffsetToCrossDoc(mReferenceFrame); - mAnimatedGeometryRootForChildren = mAnimatedGeometryRoot; if (nsLayoutUtils::IsFixedPosFrameInDisplayPort(mFrame)) { // This is an odd special case. If we are both IsFixedPosFrameInDisplayPort // and transformed that we are our own AGR parent. @@ -4908,7 +4928,7 @@ nsDisplayTransform::SetReferenceFrameToAncestor(nsDisplayListBuilder* aBuilder) // determine if we are inside a fixed pos subtree. If we use the outer AGR // from outside the fixed pos subtree FLB can't tell that we are fixed pos. mAnimatedGeometryRoot = mAnimatedGeometryRootForChildren; - } else { + } else if (mAnimatedGeometryRoot->mParentAGR) { mAnimatedGeometryRoot = mAnimatedGeometryRoot->mParentAGR; } mVisibleRect = aBuilder->GetDirtyRect() + mToReferenceFrame; @@ -5107,7 +5127,7 @@ nsDisplayTransform::ComputePerspectiveMatrix(const nsIFrame* aFrame, } nscoord perspective = cbDisplay->mChildPerspective.GetCoordValue(); if (perspective <= 0) { - return false; + return true; } TransformReferenceBox refBox(cbFrame); diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 2f01df74c6..49e91792b7 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -17,7 +17,6 @@ #include "nsIDocumentViewerPrint.h" #include "nsIDOMBeforeUnloadEvent.h" #include "nsIDocument.h" -#include "nsIDOMWindowUtils.h" #include "nsPresContext.h" #include "nsIPresShell.h" #include "nsStyleSet.h" @@ -69,6 +68,7 @@ #include "nsIClipboardHelper.h" #include "nsPIDOMWindow.h" +#include "nsGlobalWindow.h" #include "nsDOMNavigationTiming.h" #include "nsPIWindowRoot.h" #include "nsJSEnvironment.h" @@ -161,8 +161,7 @@ public: nsDocViewerSelectionListener() : mDocViewer(nullptr) - , mGotSelectionState(false) - , mSelectionWasCollapsed(false) + , mSelectionWasCollapsed(true) { } @@ -174,8 +173,7 @@ protected: virtual ~nsDocViewerSelectionListener() {} - nsDocumentViewer* mDocViewer; - bool mGotSelectionState; + nsDocumentViewer* mDocViewer; bool mSelectionWasCollapsed; }; @@ -1150,23 +1148,23 @@ nsDocumentViewer::PermitUnloadInternal(bool aCallerClosesWindow, // onbeforeunload event, don't let that happen. (see also bug#331040) RefPtr kungFuDeathGrip(this); + bool dialogsAreEnabled = false; { // Never permit popups from the beforeunload handler, no matter // how we get here. nsAutoPopupStatePusher popupStatePusher(openAbused, true); // Never permit dialogs from the beforeunload handler - nsCOMPtr utils = do_GetInterface(window); - bool dialogsWereEnabled = false; - utils->AreDialogsEnabled(&dialogsWereEnabled); - utils->DisableDialogs(); + nsGlobalWindow *globalWindow = static_cast(window); + dialogsAreEnabled = globalWindow->AreDialogsEnabled(); + globalWindow->DisableDialogs(); mInPermitUnload = true; EventDispatcher::DispatchDOMEvent(window, nullptr, event, mPresContext, nullptr); mInPermitUnload = false; - if (dialogsWereEnabled) { - utils->EnableDialogs(); + if (dialogsAreEnabled) { + globalWindow->EnableDialogs(); } } @@ -1176,7 +1174,7 @@ nsDocumentViewer::PermitUnloadInternal(bool aCallerClosesWindow, // NB: we nullcheck mDocument because it might now be dead as a result of // the event being dispatched. - if (!sIsBeforeUnloadDisabled && *aShouldPrompt && mDocument && + if (!sIsBeforeUnloadDisabled && *aShouldPrompt && dialogsAreEnabled && mDocument && (!sBeforeUnloadRequiresInteraction || mDocument->UserHasInteracted()) && (event->GetInternalNSEvent()->mFlags.mDefaultPrevented || !text.IsEmpty())) { @@ -1999,14 +1997,13 @@ nsDocumentViewer::SetBounds(const nsIntRect& aBounds) NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE); mBounds = aBounds; - if (mWindow) { - if (!mAttachedToParent) { - // Don't have the widget repaint. Layout will generate repaint requests - // during reflow. - mWindow->Resize(aBounds.x, aBounds.y, - aBounds.width, aBounds.height, - false); - } + + if (mWindow && !mAttachedToParent) { + // Resize the widget, but don't trigger repaint. Layout will generate + // repaint requests during reflow. + mWindow->Resize(aBounds.x, aBounds.y, + aBounds.width, aBounds.height, + false); } else if (mPresContext && mViewManager) { int32_t p2a = mPresContext->AppUnitsPerDevPixel(); mViewManager->SetWindowDimensions(NSIntPixelsToAppUnits(mBounds.width, p2a), @@ -3545,7 +3542,9 @@ NS_IMETHODIMP nsDocumentViewer::GetInImage(bool* aInImage) nsCOMPtr node; nsresult rv = GetPopupImageNode(getter_AddRefs(node)); if (NS_FAILED(rv)) return rv; - NS_ENSURE_TRUE(node, NS_ERROR_FAILURE); + if (!node) { + return NS_ERROR_FAILURE; + } // Make sure there is a URI assigned. This allows to // be an image but rejects other types. This matches what @@ -3580,13 +3579,13 @@ NS_IMETHODIMP nsDocViewerSelectionListener::NotifySelectionChanged(nsIDOMDocumen bool selectionCollapsed; selection->GetIsCollapsed(&selectionCollapsed); - // we only call UpdateCommands when the selection changes from collapsed - // to non-collapsed or vice versa. We might need another update string - // for simple selection changes, but that would be expenseive. - if (!mGotSelectionState || mSelectionWasCollapsed != selectionCollapsed) + // We only call UpdateCommands when the selection changes from collapsed to + // non-collapsed or vice versa, however we skip the initializing collapse. We + // might need another update string for simple selection changes, but that + // would be expenseive. + if (mSelectionWasCollapsed != selectionCollapsed) { domWindow->UpdateCommands(NS_LITERAL_STRING("select"), selection, aReason); - mGotSelectionState = true; mSelectionWasCollapsed = selectionCollapsed; } @@ -4148,7 +4147,7 @@ nsDocumentViewer::ShouldAttachToTopLevel() if (nsIWidget::UsePuppetWidgets()) return true; -#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) +#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_UIKIT) // On windows, in the parent process we also attach, but just to // chrome items nsWindowType winType = mParentWidget->WindowType(); diff --git a/layout/base/tests/browser.ini b/layout/base/tests/browser.ini index fb291a4860..802b7a6b8d 100644 --- a/layout/base/tests/browser.ini +++ b/layout/base/tests/browser.ini @@ -2,3 +2,4 @@ [browser_bug617076.js] skip-if = e10s # Bug ?????? - test touches content (TypeError: doc.documentElement is null) +[browser_disableDialogs_onbeforeunload.js] diff --git a/layout/base/tests/browser_disableDialogs_onbeforeunload.js b/layout/base/tests/browser_disableDialogs_onbeforeunload.js new file mode 100644 index 0000000000..8a2c12f0da --- /dev/null +++ b/layout/base/tests/browser_disableDialogs_onbeforeunload.js @@ -0,0 +1,54 @@ +function pageScript() { + window.addEventListener("beforeunload", function (event) { + var str = "Some text that causes the beforeunload dialog to be shown"; + event.returnValue = str; + return str; + }, true); +} + +const PAGE_URL = + "data:text/html," + encodeURIComponent(""); + +add_task(function* enableDialogs() { + // The onbeforeunload dialog should appear. + let dialogShown = false; + function onDialogShown(node) { + dialogShown = true; + let dismissButton = node.ui.button0; + dismissButton.click(); + } + let obsName = "tabmodal-dialog-loaded"; + Services.obs.addObserver(onDialogShown, obsName, false); + yield openPage(true); + Services.obs.removeObserver(onDialogShown, obsName); + Assert.ok(dialogShown); +}); + +add_task(function* disableDialogs() { + // The onbeforeunload dialog should NOT appear. + yield openPage(false); + info("If we time out here, then the dialog was shown..."); +}); + +function* openPage(enableDialogs) { + // Open about:blank in a new tab. + yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, function* (browser) { + // Load the content script in the frame. + let methodName = enableDialogs ? "enableDialogs" : "disableDialogs"; + yield ContentTask.spawn(browser, methodName, function* (name) { + Components.utils.import("resource://gre/modules/Services.jsm"); + Services.obs.addObserver(doc => { + if (content && doc == content.document) { + content.QueryInterface(Ci.nsIInterfaceRequestor). + getInterface(Ci.nsIDOMWindowUtils)[name](); + } + }, "document-element-inserted", false); + }); + // Load the page. + yield BrowserTestUtils.loadURI(browser, PAGE_URL); + yield BrowserTestUtils.browserLoaded(browser); + // And then navigate away. + yield BrowserTestUtils.loadURI(browser, "http://example.com/"); + yield BrowserTestUtils.browserLoaded(browser); + }); +} diff --git a/layout/base/tests/bug1097242-1-ref.html b/layout/base/tests/bug1097242-1-ref.html new file mode 100644 index 0000000000..dd62f18eec --- /dev/null +++ b/layout/base/tests/bug1097242-1-ref.html @@ -0,0 +1,14 @@ + + + + +

foobarbaz
+ + diff --git a/layout/base/tests/bug1097242-1.html b/layout/base/tests/bug1097242-1.html new file mode 100644 index 0000000000..dc5d55eb1b --- /dev/null +++ b/layout/base/tests/bug1097242-1.html @@ -0,0 +1,18 @@ + + + + + +
foobarbaz
+ + diff --git a/layout/base/tests/mochitest.ini b/layout/base/tests/mochitest.ini index c3474b38c4..eb7255da60 100644 --- a/layout/base/tests/mochitest.ini +++ b/layout/base/tests/mochitest.ini @@ -23,6 +23,8 @@ support-files = bug989012-3-ref.html bug1061468.html bug1061468-ref.html + bug1097242-1.html + bug1097242-1-ref.html bug1109968-1-ref.html bug1109968-1.html bug1109968-2-ref.html diff --git a/layout/base/tests/test_reftests_with_caret.html b/layout/base/tests/test_reftests_with_caret.html index e90ac0d022..90b82ead0a 100644 --- a/layout/base/tests/test_reftests_with_caret.html +++ b/layout/base/tests/test_reftests_with_caret.html @@ -150,6 +150,7 @@ var tests = [ [ 'bug1007065-1.html' , 'bug1007065-1-ref.html' ] , [ 'bug1007067-1.html' , 'bug1007067-1-ref.html' ] , [ 'bug1061468.html' , 'bug1061468-ref.html' ] , + [ 'bug1097242-1.html', 'bug1097242-1-ref.html'] , [ 'bug1109968-1.html', 'bug1109968-1-ref.html'] , [ 'bug1109968-2.html', 'bug1109968-2-ref.html'] , // [ 'bug1123067-1.html' , 'bug1123067-ref.html' ] , TODO: bug 1129205 diff --git a/layout/generic/crashtests/1225118.html b/layout/generic/crashtests/1225118.html new file mode 100644 index 0000000000..833596243f --- /dev/null +++ b/layout/generic/crashtests/1225118.html @@ -0,0 +1,4 @@ + + + + diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index 9e988a590c..19ec9f66a3 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -597,6 +597,7 @@ load 1221874-1.html load 1222783.xhtml load 1223568-1.html load 1223568-2.html +pref(layout.css.grid.enabled,true) load 1225118.html pref(layout.css.grid.enabled,true) load 1225376.html load details-display-none-summary-1.html load details-display-none-summary-2.html diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 64869a1a21..e128a9a2d3 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1097,7 +1097,7 @@ ScrollFrameHelper::HandleScrollbarStyleSwitching() } } -#if defined(MOZ_B2G) || (defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_ANDROID_APZ)) +#if defined(MOZ_B2G) || defined(MOZ_WIDGET_ANDROID) static bool IsFocused(nsIContent* aContent) { // Some content elements, like the GetContent() of a scroll frame @@ -1139,7 +1139,7 @@ ScrollFrameHelper::WantAsyncScroll() const bool isHScrollable = !!(directions & nsIScrollableFrame::HORIZONTAL) && (styles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN); -#if defined(MOZ_B2G) || (defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_ANDROID_APZ)) +#if defined(MOZ_B2G) || defined(MOZ_WIDGET_ANDROID) // Mobile platforms need focus to scroll. bool canScrollWithoutScrollbars = IsFocused(mOuter->GetContent()); #else diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index ea0cd2e9bd..ac31646c40 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -683,12 +683,7 @@ bool IsMinContent(const nsStyleCoord& aCoord) } /** - * Search for the aNth occurrence of aName in aNameList (forward), starting at - * the zero-based aFromIndex, and return the 1-based index (line number). - * Also take into account there is an unconditional match at aImplicitLine - * unless it's zero. - * Return zero if aNth occurrences can't be found. In that case, aNth has - * been decremented with the number of occurrences that were found (if any). + * @see FindNamedLine, this function searches forward. */ static uint32_t FindLine(const nsString& aName, int32_t* aNth, @@ -721,7 +716,7 @@ FindLine(const nsString& aName, int32_t* aNth, } /** - * @see FindLine, this function does the same but searches in reverse. + * @see FindNamedLine, this function searches in reverse. */ static uint32_t RFindLine(const nsString& aName, int32_t* aNth, @@ -729,6 +724,10 @@ RFindLine(const nsString& aName, int32_t* aNth, const nsTArray>& aNameList) { MOZ_ASSERT(aNth && *aNth > 0); + if (MOZ_UNLIKELY(aFromIndex == 0)) { + return 0; // There are no named lines beyond the start of the explicit grid. + } + --aFromIndex; // (shift aFromIndex so we can treat it as inclusive) int32_t nth = *aNth; const uint32_t len = aNameList.Length(); // The implicit line may be beyond the length of aNameList so we match this @@ -738,8 +737,7 @@ RFindLine(const nsString& aName, int32_t* aNth, return aImplicitLine; } } - uint32_t i = aFromIndex == 0 ? len : std::min(aFromIndex, len); - for (; i; --i) { + for (uint32_t i = std::min(aFromIndex, len); i; --i) { if (i == aImplicitLine || aNameList[i - 1].Contains(aName)) { if (--nth == 0) { return i; @@ -751,6 +749,22 @@ RFindLine(const nsString& aName, int32_t* aNth, return 0; } +/** + * Find the aNth occurrence of aName, searching forward if aNth is positive, + * and in reverse if aNth is negative (aNth == 0 is invalid), starting from + * aFromIndex (not inclusive), and return a 1-based line number. + * Also take into account there is an unconditional match at aImplicitLine + * unless it's zero. + * Return zero if aNth occurrences can't be found. In that case, aNth has + * been decremented with the number of occurrences that were found (if any). + * + * E.g. to search for "A 2" forward from the start of the grid: aName is "A" + * aNth is 2 and aFromIndex is zero. To search for "A -2", aNth is -2 and + * aFromIndex is ExplicitGridEnd + 1 (which is the line "before" the last + * line when we're searching in reverse). For "span A 2", aNth is 2 when + * used on a grid-[row|column]-end property and -2 for a *-start property, + * and aFromIndex is the line (which we should skip) on the opposite property. + */ static uint32_t FindNamedLine(const nsString& aName, int32_t* aNth, uint32_t aFromIndex, uint32_t aImplicitLine, @@ -814,11 +828,29 @@ IsNameWithStartSuffix(const nsString& aString, uint32_t* aIndex) return IsNameWithSuffix(aString, NS_LITERAL_STRING("-start"), aIndex); } +enum class GridLineSide { + eBeforeGridGap, + eAfterGridGap, +}; + static nscoord -GridLinePosition(uint32_t aLine, const nsTArray& aTrackSizes) +GridLineEdge(uint32_t aLine, const nsTArray& aTrackSizes, + GridLineSide aSide) { - MOZ_ASSERT(aTrackSizes.Length() > 0, "There are no lines in this grid"); + if (MOZ_UNLIKELY(aTrackSizes.IsEmpty())) { + // https://drafts.csswg.org/css-grid/#grid-definition + // "... the explicit grid still contains one grid line in each axis." + MOZ_ASSERT(aLine == 0, "We should only resolve line 1 in an empty grid"); + return nscoord(0); + } MOZ_ASSERT(aLine <= aTrackSizes.Length(), "aTrackSizes is too small"); + if (aSide == GridLineSide::eBeforeGridGap) { + if (aLine == 0) { + return aTrackSizes[0].mPosition; + } + const TrackSize& sz = aTrackSizes[aLine - 1]; + return sz.mPosition + sz.mBase; + } if (aLine == aTrackSizes.Length()) { const TrackSize& sz = aTrackSizes[aLine - 1]; return sz.mPosition + sz.mBase; @@ -855,6 +887,7 @@ SpaceToFill(WritingMode aWM, const LogicalSize& aSize, nscoord aMargin, return aCBSize - (size + aMargin); } +// Align (or stretch) an item's margin box in its aAxis inside aCBSize. static bool AlignJustifySelf(uint8_t aAlignment, bool aOverflowSafe, LogicalAxis aAxis, bool aSameSide, nscoord aCBSize, const nsHTMLReflowState& aRS, @@ -945,7 +978,7 @@ AlignJustifySelf(uint8_t aAlignment, bool aOverflowSafe, LogicalAxis aAxis, // Set the position and size (aPos/aContentSize) for the requested alignment. bool didResize = false; - nscoord offset = 0; + nscoord offset = 0; // NOTE: this is the resulting frame offset (border box). switch (aAlignment) { case NS_STYLE_ALIGN_BASELINE: case NS_STYLE_ALIGN_LAST_BASELINE: @@ -959,10 +992,12 @@ AlignJustifySelf(uint8_t aAlignment, bool aOverflowSafe, LogicalAxis aAxis, offset = aCBSize - (size + marginEnd); break; } - case NS_STYLE_ALIGN_CENTER: - offset = SpaceToFill(wm, aChildSize, marginStart + marginEnd, - aAxis, aCBSize) / 2; + case NS_STYLE_ALIGN_CENTER: { + nscoord size = aAxis == eLogicalAxisBlock ? aChildSize.BSize(wm) + : aChildSize.ISize(wm); + offset = (aCBSize - size + marginStart - marginEnd) / 2; break; + } case NS_STYLE_ALIGN_STRETCH: { MOZ_ASSERT(!hasAutoMarginStart && !hasAutoMarginEnd); offset = marginStart; @@ -983,7 +1018,6 @@ AlignJustifySelf(uint8_t aAlignment, bool aOverflowSafe, LogicalAxis aAxis, nscoord bpInAxis = aAxis == eLogicalAxisBlock ? bp.BStartEnd(wm) : bp.IStartEnd(wm); nscoord contentSize = size - bpInAxis; - NS_ASSERTION(contentSize >= 0, "huh?"); const nscoord unstretchedContentSize = contentSize; contentSize += gap; nscoord max = aAxis == eLogicalAxisBlock ? aRS.ComputedMaxBSize() @@ -994,7 +1028,8 @@ AlignJustifySelf(uint8_t aAlignment, bool aOverflowSafe, LogicalAxis aAxis, } // |gap| is now how much the content size is actually allowed to grow. didResize = gap > 0; - if (didResize) { + // (nscoord overflow can make |contentSize| negative, bug 1225118) + if (didResize && MOZ_LIKELY(contentSize >= 0)) { (aAxis == eLogicalAxisBlock ? aContentSize->BSize(wm) : aContentSize->ISize(wm)) = contentSize; if (MOZ_UNLIKELY(!aSameSide)) { @@ -1187,33 +1222,22 @@ nsGridContainerFrame::AddImplicitNamedAreas( const nsTArray>& aLineNameLists) { // http://dev.w3.org/csswg/css-grid/#implicit-named-areas - // XXX this just checks x-start .. x-end in one dimension and there's - // no other error checking. A few wrong cases (maybe): - // (x-start x-end) - // (x-start) 0 (x-start) 0 (x-end) - // (x-end) 0 (x-start) 0 (x-end) - // (x-start) 0 (x-end) 0 (x-start) 0 (x-end) + // Note: recording these names for fast lookup later is just an optimization. const uint32_t len = std::min(aLineNameLists.Length(), size_t(nsStyleGridLine::kMaxLine)); nsTHashtable currentStarts; ImplicitNamedAreas* areas = GetImplicitNamedAreas(); for (uint32_t i = 0; i < len; ++i) { - const nsTArray& names(aLineNameLists[i]); - const uint32_t jLen = names.Length(); - for (uint32_t j = 0; j < jLen; ++j) { - const nsString& name = names[j]; + for (const nsString& name : aLineNameLists[i]) { uint32_t index; - if (::IsNameWithStartSuffix(name, &index)) { - currentStarts.PutEntry(nsDependentSubstring(name, 0, index)); - } else if (::IsNameWithEndSuffix(name, &index)) { + if (::IsNameWithStartSuffix(name, &index) || + ::IsNameWithEndSuffix(name, &index)) { nsDependentSubstring area(name, 0, index); - if (currentStarts.Contains(area)) { - if (!areas) { - areas = new ImplicitNamedAreas; - Properties().Set(ImplicitNamedAreasProperty(), areas); - } - areas->PutEntry(area); + if (!areas) { + areas = new ImplicitNamedAreas; + Properties().Set(ImplicitNamedAreasProperty(), areas); } + areas->PutEntry(area); } } } @@ -1273,8 +1297,6 @@ nsGridContainerFrame::ResolveLine( lineName.AppendLiteral("-end"); implicitLine = area ? area->*aAreaEnd : 0; } - // XXX must Implicit Named Areas have all four lines? - // http://dev.w3.org/csswg/css-grid/#implicit-named-areas line = ::FindNamedLine(lineName, &aNth, aFromIndex, implicitLine, aLineNameList); } @@ -1347,7 +1369,8 @@ nsGridContainerFrame::ResolveLineRangeHelper( return LinePair(kAutoLine, 1); // XXX subgrid explicit size instead of 1? } - auto end = ResolveLine(aEnd, aEnd.mInteger, 0, aLineNameList, aAreaStart, + uint32_t from = aEnd.mInteger < 0 ? aExplicitGridEnd + 1: 0; + auto end = ResolveLine(aEnd, aEnd.mInteger, from, aLineNameList, aAreaStart, aAreaEnd, aExplicitGridEnd, eLineRangeSideEnd, aStyle); int32_t span = aStart.mInteger == 0 ? 1 : aStart.mInteger; @@ -1380,9 +1403,10 @@ nsGridContainerFrame::ResolveLineRangeHelper( return LinePair(start, 1); // XXX subgrid explicit size instead of 1? } } else { - start = ResolveLine(aStart, aStart.mInteger, 0, aLineNameList, aAreaStart, - aAreaEnd, aExplicitGridEnd, eLineRangeSideStart, - aStyle); + uint32_t from = aStart.mInteger < 0 ? aExplicitGridEnd + 1: 0; + start = ResolveLine(aStart, aStart.mInteger, from, aLineNameList, + aAreaStart, aAreaEnd, aExplicitGridEnd, + eLineRangeSideStart, aStyle); if (aEnd.IsAuto()) { // A "definite line / auto" should resolve the auto to 'span 1'. // The error handling in ResolveLineRange will make that happen and also @@ -1391,14 +1415,14 @@ nsGridContainerFrame::ResolveLineRangeHelper( } } - uint32_t from = 0; + uint32_t from; int32_t nth = aEnd.mInteger == 0 ? 1 : aEnd.mInteger; if (aEnd.mHasSpan) { if (MOZ_UNLIKELY(start < 0)) { if (aEnd.mLineName.IsEmpty()) { return LinePair(start, start + nth); } - // Fall through and start searching from the start of the grid (from=0). + from = 0; } else { if (start >= int32_t(aExplicitGridEnd)) { // The start is at or after the last explicit line, thus all lines @@ -1407,6 +1431,8 @@ nsGridContainerFrame::ResolveLineRangeHelper( } from = start; } + } else { + from = aEnd.mInteger < 0 ? aExplicitGridEnd + 1: 0; } auto end = ResolveLine(aEnd, nth, from, aLineNameList, aAreaStart, aAreaEnd, aExplicitGridEnd, eLineRangeSideEnd, aStyle); @@ -1436,12 +1462,16 @@ nsGridContainerFrame::ResolveLineRange( // range has a HypotheticalEnd <= kMaxLine. // http://dev.w3.org/csswg/css-grid/#overlarge-grids r.second = std::min(r.second, nsStyleGridLine::kMaxLine - 1); - } else if (r.second <= r.first) { + } else { // http://dev.w3.org/csswg/css-grid/#grid-placement-errors - if (MOZ_UNLIKELY(r.first == nsStyleGridLine::kMaxLine)) { - r.first = nsStyleGridLine::kMaxLine - 1; + if (r.first > r.second) { + Swap(r.first, r.second); + } else if (r.first == r.second) { + if (MOZ_UNLIKELY(r.first == nsStyleGridLine::kMaxLine)) { + r.first = nsStyleGridLine::kMaxLine - 1; + } + r.second = r.first + 1; // XXX subgrid explicit size instead of 1? } - r.second = r.first + 1; // XXX subgrid explicit size instead of 1? } return LineRange(r.first, r.second); } @@ -1478,9 +1508,10 @@ nsGridContainerFrame::ResolveAbsPosLineRange( if (aEnd.IsAuto()) { return LineRange(kAutoLine, kAutoLine); } - int32_t end = ResolveLine(aEnd, aEnd.mInteger, 0, aLineNameList, aAreaStart, - aAreaEnd, aExplicitGridEnd, eLineRangeSideEnd, - aStyle); + uint32_t from = aEnd.mInteger < 0 ? aExplicitGridEnd + 1: 0; + int32_t end = + ResolveLine(aEnd, aEnd.mInteger, from, aLineNameList, aAreaStart, + aAreaEnd, aExplicitGridEnd, eLineRangeSideEnd, aStyle); if (aEnd.mHasSpan) { ++end; } @@ -1490,8 +1521,9 @@ nsGridContainerFrame::ResolveAbsPosLineRange( } if (aEnd.IsAuto()) { + uint32_t from = aStart.mInteger < 0 ? aExplicitGridEnd + 1: 0; int32_t start = - ResolveLine(aStart, aStart.mInteger, 0, aLineNameList, aAreaStart, + ResolveLine(aStart, aStart.mInteger, from, aLineNameList, aAreaStart, aAreaEnd, aExplicitGridEnd, eLineRangeSideStart, aStyle); if (aStart.mHasSpan) { start = std::max(aGridEnd - start, aGridStart); @@ -1532,15 +1564,12 @@ nsGridContainerFrame::FindAutoCol(uint32_t aStartCol, uint32_t aLockedRow, // Find the first gap in the current row that's at least 'extent' wide. // ('gap' tracks how wide the current column gap is.) for (uint32_t j = candidate, gap = 0; j < len && gap < extent; ++j) { - ++gap; // tentative, but we may reset it below if a column is occupied - if (cellsInRow[j].mIsOccupied) { - // Optimization: skip as many occupied cells as we can. - do { - ++j; - } while (j < len && cellsInRow[j].mIsOccupied); - candidate = j; - gap = 0; + if (!cellsInRow[j].mIsOccupied) { + ++gap; + continue; } + candidate = j + 1; + gap = 0; } if (lastCandidate < candidate && i != iStart) { // Couldn't fit 'extent' tracks at 'lastCandidate' here so we must @@ -2785,13 +2814,15 @@ nsGridContainerFrame::LineRange::ToPositionAndLengthForAbsPos( // done } else { const nscoord endPos = *aPos + *aLength; - nscoord startPos = ::GridLinePosition(mStart, aTrackSizes); + nscoord startPos = + ::GridLineEdge(mStart, aTrackSizes, GridLineSide::eAfterGridGap); *aPos = aGridOrigin + startPos; *aLength = std::max(endPos - *aPos, 0); } } else { if (mStart == kAutoLine) { - nscoord endPos = ::GridLinePosition(mEnd, aTrackSizes); + nscoord endPos = + ::GridLineEdge(mEnd, aTrackSizes, GridLineSide::eBeforeGridGap); *aLength = std::max(aGridOrigin + endPos, 0); } else { nscoord pos; @@ -3023,6 +3054,9 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext, bSize += gridReflowState.mRows.mSizes[i].mBase; } bSize += gridReflowState.mRows.SumOfGridGaps(); + bSize = NS_CSS_MINMAX(bSize, + aReflowState.ComputedMinBSize(), + aReflowState.ComputedMaxBSize()); } else { bSize = computedBSize; } diff --git a/layout/reftests/bidi/1217833-1-ref.html b/layout/reftests/bidi/1217833-1-ref.html new file mode 100644 index 0000000000..9ed72ef3dd --- /dev/null +++ b/layout/reftests/bidi/1217833-1-ref.html @@ -0,0 +1,16 @@ + + + + + +
test
diff --git a/layout/reftests/bidi/1217833-1.html b/layout/reftests/bidi/1217833-1.html new file mode 100644 index 0000000000..2a1eea3259 --- /dev/null +++ b/layout/reftests/bidi/1217833-1.html @@ -0,0 +1,18 @@ + + + + + +
test
diff --git a/layout/reftests/bidi/1217833-2-ref.html b/layout/reftests/bidi/1217833-2-ref.html new file mode 100644 index 0000000000..e328be5f97 --- /dev/null +++ b/layout/reftests/bidi/1217833-2-ref.html @@ -0,0 +1,21 @@ + + + + + +
הקידבtest
diff --git a/layout/reftests/bidi/1217833-2.html b/layout/reftests/bidi/1217833-2.html new file mode 100644 index 0000000000..699947a2d3 --- /dev/null +++ b/layout/reftests/bidi/1217833-2.html @@ -0,0 +1,23 @@ + + + + + +
testבדיקה
diff --git a/layout/reftests/bidi/817406-1-ref.html b/layout/reftests/bidi/817406-1-ref.html new file mode 100644 index 0000000000..1e3e747028 --- /dev/null +++ b/layout/reftests/bidi/817406-1-ref.html @@ -0,0 +1,4 @@ + + +
+ diff --git a/layout/reftests/bidi/817406-1.html b/layout/reftests/bidi/817406-1.html new file mode 100644 index 0000000000..d01fa724e5 --- /dev/null +++ b/layout/reftests/bidi/817406-1.html @@ -0,0 +1,4 @@ + + +
+ diff --git a/layout/reftests/bidi/817406-2-ref.html b/layout/reftests/bidi/817406-2-ref.html new file mode 100644 index 0000000000..fd1f20e0cf --- /dev/null +++ b/layout/reftests/bidi/817406-2-ref.html @@ -0,0 +1,4 @@ + + +
+ diff --git a/layout/reftests/bidi/817406-2.html b/layout/reftests/bidi/817406-2.html new file mode 100644 index 0000000000..ebc3ebb98c --- /dev/null +++ b/layout/reftests/bidi/817406-2.html @@ -0,0 +1,4 @@ + + +
+ diff --git a/layout/reftests/bidi/817406-3.html b/layout/reftests/bidi/817406-3.html new file mode 100644 index 0000000000..90313bde4a --- /dev/null +++ b/layout/reftests/bidi/817406-3.html @@ -0,0 +1,6 @@ + + + +
+ + diff --git a/layout/reftests/bidi/817406-4-ref.html b/layout/reftests/bidi/817406-4-ref.html new file mode 100644 index 0000000000..e6e1c8d1fa --- /dev/null +++ b/layout/reftests/bidi/817406-4-ref.html @@ -0,0 +1,6 @@ + + + +
+ + diff --git a/layout/reftests/bidi/817406-4.html b/layout/reftests/bidi/817406-4.html new file mode 100644 index 0000000000..3e90274248 --- /dev/null +++ b/layout/reftests/bidi/817406-4.html @@ -0,0 +1,6 @@ + + + +
+ + diff --git a/layout/reftests/bidi/brackets-1a-ltr-ref.html b/layout/reftests/bidi/brackets-1a-ltr-ref.html new file mode 100644 index 0000000000..b8e702bef6 --- /dev/null +++ b/layout/reftests/bidi/brackets-1a-ltr-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
בא(דג[&ef]!)gh
diff --git a/layout/reftests/bidi/brackets-1a-ltr.html b/layout/reftests/bidi/brackets-1a-ltr.html new file mode 100644 index 0000000000..4b134f3517 --- /dev/null +++ b/layout/reftests/bidi/brackets-1a-ltr.html @@ -0,0 +1,16 @@ + + + + + + + + + +
אב(גד[&ef]!)gh
diff --git a/layout/reftests/bidi/brackets-1a-rtl-ref.html b/layout/reftests/bidi/brackets-1a-rtl-ref.html new file mode 100644 index 0000000000..f72f17514c --- /dev/null +++ b/layout/reftests/bidi/brackets-1a-rtl-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
gh(![ef&]דג)בא
diff --git a/layout/reftests/bidi/brackets-1a-rtl.html b/layout/reftests/bidi/brackets-1a-rtl.html new file mode 100644 index 0000000000..3672e7b953 --- /dev/null +++ b/layout/reftests/bidi/brackets-1a-rtl.html @@ -0,0 +1,16 @@ + + + + + + + + + +
אב(גד[&ef]!)gh
diff --git a/layout/reftests/bidi/brackets-1b-ltr-ref.html b/layout/reftests/bidi/brackets-1b-ltr-ref.html new file mode 100644 index 0000000000..78dd025099 --- /dev/null +++ b/layout/reftests/bidi/brackets-1b-ltr-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
gh(דג[&ef]!)בא
diff --git a/layout/reftests/bidi/brackets-1b-ltr.html b/layout/reftests/bidi/brackets-1b-ltr.html new file mode 100644 index 0000000000..edc047854c --- /dev/null +++ b/layout/reftests/bidi/brackets-1b-ltr.html @@ -0,0 +1,16 @@ + + + + + + + + + +
gh(גד[&ef]!)אב
diff --git a/layout/reftests/bidi/brackets-1b-rtl-ref.html b/layout/reftests/bidi/brackets-1b-rtl-ref.html new file mode 100644 index 0000000000..e627a9e9d8 --- /dev/null +++ b/layout/reftests/bidi/brackets-1b-rtl-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
בא(![ef&]דג)gh
diff --git a/layout/reftests/bidi/brackets-1b-rtl.html b/layout/reftests/bidi/brackets-1b-rtl.html new file mode 100644 index 0000000000..d7ef85e107 --- /dev/null +++ b/layout/reftests/bidi/brackets-1b-rtl.html @@ -0,0 +1,16 @@ + + + + + + + + + +
gh(גד[&ef]!)אב
diff --git a/layout/reftests/bidi/brackets-1c-ltr-ref.html b/layout/reftests/bidi/brackets-1c-ltr-ref.html new file mode 100644 index 0000000000..df397968d0 --- /dev/null +++ b/layout/reftests/bidi/brackets-1c-ltr-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
בא(ef[&דג]!)gh
diff --git a/layout/reftests/bidi/brackets-1c-ltr.html b/layout/reftests/bidi/brackets-1c-ltr.html new file mode 100644 index 0000000000..a13eb5c675 --- /dev/null +++ b/layout/reftests/bidi/brackets-1c-ltr.html @@ -0,0 +1,16 @@ + + + + + + + + + +
אב(ef[&גד]!)gh
diff --git a/layout/reftests/bidi/brackets-1c-rtl-ref.html b/layout/reftests/bidi/brackets-1c-rtl-ref.html new file mode 100644 index 0000000000..989f48e070 --- /dev/null +++ b/layout/reftests/bidi/brackets-1c-rtl-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
gh(![דג&]ef)בא
diff --git a/layout/reftests/bidi/brackets-1c-rtl.html b/layout/reftests/bidi/brackets-1c-rtl.html new file mode 100644 index 0000000000..852e26e108 --- /dev/null +++ b/layout/reftests/bidi/brackets-1c-rtl.html @@ -0,0 +1,16 @@ + + + + + + + + + +
אב(ef[&גד]!)gh
diff --git a/layout/reftests/bidi/brackets-2a-ltr-ref.html b/layout/reftests/bidi/brackets-2a-ltr-ref.html new file mode 100644 index 0000000000..0e624bddcd --- /dev/null +++ b/layout/reftests/bidi/brackets-2a-ltr-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
smith (fabrikam يبرعلا) תירבע
diff --git a/layout/reftests/bidi/brackets-2a-ltr.html b/layout/reftests/bidi/brackets-2a-ltr.html new file mode 100644 index 0000000000..74feb7f2f3 --- /dev/null +++ b/layout/reftests/bidi/brackets-2a-ltr.html @@ -0,0 +1,16 @@ + + + + + + + + + +
smith (fabrikam العربي) עברית
diff --git a/layout/reftests/bidi/brackets-2a-rtl-ref.html b/layout/reftests/bidi/brackets-2a-rtl-ref.html new file mode 100644 index 0000000000..7860238ae8 --- /dev/null +++ b/layout/reftests/bidi/brackets-2a-rtl-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
תירבע (يبرعلا fabrikam) smith
diff --git a/layout/reftests/bidi/brackets-2a-rtl.html b/layout/reftests/bidi/brackets-2a-rtl.html new file mode 100644 index 0000000000..02d10e27a5 --- /dev/null +++ b/layout/reftests/bidi/brackets-2a-rtl.html @@ -0,0 +1,16 @@ + + + + + + + + + +
smith (fabrikam العربي) עברית
diff --git a/layout/reftests/bidi/brackets-2b-ltr-ref.html b/layout/reftests/bidi/brackets-2b-ltr-ref.html new file mode 100644 index 0000000000..271c8445b9 --- /dev/null +++ b/layout/reftests/bidi/brackets-2b-ltr-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
תירבע (fabrikam يبرعلا) smith
diff --git a/layout/reftests/bidi/brackets-2b-ltr.html b/layout/reftests/bidi/brackets-2b-ltr.html new file mode 100644 index 0000000000..f6a70f62b6 --- /dev/null +++ b/layout/reftests/bidi/brackets-2b-ltr.html @@ -0,0 +1,16 @@ + + + + + + + + + +
עברית (fabrikam العربي) smith
diff --git a/layout/reftests/bidi/brackets-2b-rtl-ref.html b/layout/reftests/bidi/brackets-2b-rtl-ref.html new file mode 100644 index 0000000000..4a9dcf1070 --- /dev/null +++ b/layout/reftests/bidi/brackets-2b-rtl-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
smith (يبرعلا fabrikam) תירבע
diff --git a/layout/reftests/bidi/brackets-2b-rtl.html b/layout/reftests/bidi/brackets-2b-rtl.html new file mode 100644 index 0000000000..f0579c903b --- /dev/null +++ b/layout/reftests/bidi/brackets-2b-rtl.html @@ -0,0 +1,16 @@ + + + + + + + + + +
עברית (fabrikam العربي) smith
diff --git a/layout/reftests/bidi/brackets-2c-ltr-ref.html b/layout/reftests/bidi/brackets-2c-ltr-ref.html new file mode 100644 index 0000000000..c27a71e604 --- /dev/null +++ b/layout/reftests/bidi/brackets-2c-ltr-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
smith (يبرعلا fabrikam) תירבע
diff --git a/layout/reftests/bidi/brackets-2c-ltr.html b/layout/reftests/bidi/brackets-2c-ltr.html new file mode 100644 index 0000000000..481ee51c65 --- /dev/null +++ b/layout/reftests/bidi/brackets-2c-ltr.html @@ -0,0 +1,16 @@ + + + + + + + + + +
smith (العربي fabrikam) עברית
diff --git a/layout/reftests/bidi/brackets-2c-rtl-ref.html b/layout/reftests/bidi/brackets-2c-rtl-ref.html new file mode 100644 index 0000000000..635a1bd80d --- /dev/null +++ b/layout/reftests/bidi/brackets-2c-rtl-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
תירבע (fabrikam يبرعلا) smith
diff --git a/layout/reftests/bidi/brackets-2c-rtl.html b/layout/reftests/bidi/brackets-2c-rtl.html new file mode 100644 index 0000000000..1fa504546e --- /dev/null +++ b/layout/reftests/bidi/brackets-2c-rtl.html @@ -0,0 +1,16 @@ + + + + + + + + + +
smith (العربي fabrikam) עברית
diff --git a/layout/reftests/bidi/brackets-3a-ltr-ref.html b/layout/reftests/bidi/brackets-3a-ltr-ref.html new file mode 100644 index 0000000000..7ccd06f0da --- /dev/null +++ b/layout/reftests/bidi/brackets-3a-ltr-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
يبرعلا book(s)
diff --git a/layout/reftests/bidi/brackets-3a-ltr.html b/layout/reftests/bidi/brackets-3a-ltr.html new file mode 100644 index 0000000000..6245352875 --- /dev/null +++ b/layout/reftests/bidi/brackets-3a-ltr.html @@ -0,0 +1,16 @@ + + + + + + + + + +
العربي book(s)
diff --git a/layout/reftests/bidi/brackets-3a-rtl-ref.html b/layout/reftests/bidi/brackets-3a-rtl-ref.html new file mode 100644 index 0000000000..038a72c878 --- /dev/null +++ b/layout/reftests/bidi/brackets-3a-rtl-ref.html @@ -0,0 +1,15 @@ + + + + + + + + +
book(s) يبرعلا
diff --git a/layout/reftests/bidi/brackets-3a-rtl.html b/layout/reftests/bidi/brackets-3a-rtl.html new file mode 100644 index 0000000000..9fdea3fd32 --- /dev/null +++ b/layout/reftests/bidi/brackets-3a-rtl.html @@ -0,0 +1,16 @@ + + + + + + + + + +
العربي book(s)
diff --git a/layout/reftests/bidi/brackets-3b-ltr-ref.html b/layout/reftests/bidi/brackets-3b-ltr-ref.html new file mode 100644 index 0000000000..86936ae9c0 --- /dev/null +++ b/layout/reftests/bidi/brackets-3b-ltr-ref.html @@ -0,0 +1,16 @@ + + + + + + + + +
arabic (كُتُب)كِتَاب
diff --git a/layout/reftests/bidi/brackets-3b-ltr.html b/layout/reftests/bidi/brackets-3b-ltr.html new file mode 100644 index 0000000000..004f31a578 --- /dev/null +++ b/layout/reftests/bidi/brackets-3b-ltr.html @@ -0,0 +1,16 @@ + + + + + + + + + +
arabic كِتَاب(كُتُب)
diff --git a/layout/reftests/bidi/brackets-3b-rtl-ref.html b/layout/reftests/bidi/brackets-3b-rtl-ref.html new file mode 100644 index 0000000000..cbb3408d02 --- /dev/null +++ b/layout/reftests/bidi/brackets-3b-rtl-ref.html @@ -0,0 +1,16 @@ + + + + + + + + +
(كُتُب)كِتَاب arabic
diff --git a/layout/reftests/bidi/brackets-3b-rtl.html b/layout/reftests/bidi/brackets-3b-rtl.html new file mode 100644 index 0000000000..916b8736f6 --- /dev/null +++ b/layout/reftests/bidi/brackets-3b-rtl.html @@ -0,0 +1,16 @@ + + + + + + + + + +
arabic كِتَاب(كُتُب)
diff --git a/layout/reftests/bidi/reftest.list b/layout/reftests/bidi/reftest.list index 2c737edf39..83b9afb0f3 100644 --- a/layout/reftests/bidi/reftest.list +++ b/layout/reftests/bidi/reftest.list @@ -139,6 +139,10 @@ skip-if(B2G||Mulet) == 726420-1.html 726420-1-ref.html # Initial mulet triage: p == 746987-4.html 746987-4-ref.html == 779003-1.html 779003-1-ref.html == 779003-1-dynamic.html 779003-1-ref.html +== 817406-1.html 817406-1-ref.html +== 817406-2.html 817406-2-ref.html +== 817406-3.html 817406-1-ref.html +== 817406-4.html 817406-4-ref.html == 847242-1.html 847242-1-ref.html skip-if((B2G&&browserIsRemote)||Mulet) == 869833-1.xul 869833-1-ref.xul # Initial mulet triage: parity with B2G/B2G Desktop == 922530-1.html 922530-1-ref.html @@ -150,3 +154,21 @@ skip-if(B2G||Mulet) != 1155359-1.xul 1155359-1-ref.xul == 1157726-1.html 1157726-1-ref.html == 1161752.html 1161752-ref.html == 1161752-5-embed.html 1161752-5-embed-ref.html +== brackets-1a-ltr.html brackets-1a-ltr-ref.html +== brackets-1a-rtl.html brackets-1a-rtl-ref.html +== brackets-1b-ltr.html brackets-1b-ltr-ref.html +== brackets-1b-rtl.html brackets-1b-rtl-ref.html +== brackets-1c-ltr.html brackets-1c-ltr-ref.html +== brackets-1c-rtl.html brackets-1c-rtl-ref.html +== brackets-2a-ltr.html brackets-2a-ltr-ref.html +fuzzy-if(Android,254,557) == brackets-2a-rtl.html brackets-2a-rtl-ref.html +== brackets-2b-ltr.html brackets-2b-ltr-ref.html +== brackets-2b-rtl.html brackets-2b-rtl-ref.html +== brackets-2c-ltr.html brackets-2c-ltr-ref.html +fuzzy-if(Android,254,231) == brackets-2c-rtl.html brackets-2c-rtl-ref.html +== brackets-3a-ltr.html brackets-3a-ltr-ref.html +== brackets-3a-rtl.html brackets-3a-rtl-ref.html +== brackets-3b-ltr.html brackets-3b-ltr-ref.html +== brackets-3b-rtl.html brackets-3b-rtl-ref.html +== 1217833-1.html 1217833-1-ref.html +== 1217833-2.html 1217833-2-ref.html diff --git a/layout/reftests/box-shadow/1178575-2-ref.html b/layout/reftests/box-shadow/1178575-2-ref.html new file mode 100644 index 0000000000..2e2b09a57c --- /dev/null +++ b/layout/reftests/box-shadow/1178575-2-ref.html @@ -0,0 +1,29 @@ + + + + Testcase #2 for bug 1178575 + + +
diff --git a/layout/reftests/box-shadow/1178575-2.html b/layout/reftests/box-shadow/1178575-2.html new file mode 100644 index 0000000000..41365bf35b --- /dev/null +++ b/layout/reftests/box-shadow/1178575-2.html @@ -0,0 +1,35 @@ + + + + Testcase #2 for bug 1178575 + + + +
diff --git a/layout/reftests/box-shadow/1178575-ref.html b/layout/reftests/box-shadow/1178575-ref.html new file mode 100644 index 0000000000..3a6442dddb --- /dev/null +++ b/layout/reftests/box-shadow/1178575-ref.html @@ -0,0 +1,22 @@ + + + + Testcase for bug 1178575 + + +
diff --git a/layout/reftests/box-shadow/1178575.html b/layout/reftests/box-shadow/1178575.html new file mode 100644 index 0000000000..a3edc82086 --- /dev/null +++ b/layout/reftests/box-shadow/1178575.html @@ -0,0 +1,28 @@ + + + + Testcase for bug 1178575 + + + +
diff --git a/layout/reftests/box-shadow/1212823-1-ref.html b/layout/reftests/box-shadow/1212823-1-ref.html new file mode 100644 index 0000000000..91cf26d3cc --- /dev/null +++ b/layout/reftests/box-shadow/1212823-1-ref.html @@ -0,0 +1,7 @@ + + + +
+ + + diff --git a/layout/reftests/box-shadow/1212823-1.html b/layout/reftests/box-shadow/1212823-1.html new file mode 100644 index 0000000000..2337ddf75f --- /dev/null +++ b/layout/reftests/box-shadow/1212823-1.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/layout/reftests/box-shadow/boxshadow-inset-neg-spread2-ref.html b/layout/reftests/box-shadow/boxshadow-inset-neg-spread2-ref.html new file mode 100644 index 0000000000..b6b1a3dfc2 --- /dev/null +++ b/layout/reftests/box-shadow/boxshadow-inset-neg-spread2-ref.html @@ -0,0 +1,16 @@ + + + + + + +
+ + diff --git a/layout/reftests/box-shadow/boxshadow-inset-neg-spread2.html b/layout/reftests/box-shadow/boxshadow-inset-neg-spread2.html new file mode 100644 index 0000000000..b846f25aba --- /dev/null +++ b/layout/reftests/box-shadow/boxshadow-inset-neg-spread2.html @@ -0,0 +1,20 @@ + + + + + + +
+ + diff --git a/layout/reftests/box-shadow/boxshadow-large-offset-ref.html b/layout/reftests/box-shadow/boxshadow-large-offset-ref.html new file mode 100644 index 0000000000..2160b81479 --- /dev/null +++ b/layout/reftests/box-shadow/boxshadow-large-offset-ref.html @@ -0,0 +1,50 @@ + + + + + +
+
+
+
+
+ + diff --git a/layout/reftests/box-shadow/boxshadow-large-offset.html b/layout/reftests/box-shadow/boxshadow-large-offset.html new file mode 100644 index 0000000000..5df87c368b --- /dev/null +++ b/layout/reftests/box-shadow/boxshadow-large-offset.html @@ -0,0 +1,49 @@ + + + + + +
+
+
+
+ + diff --git a/layout/reftests/box-shadow/reftest.list b/layout/reftests/box-shadow/reftest.list index f690ab9bcc..b5351132f3 100644 --- a/layout/reftests/box-shadow/reftest.list +++ b/layout/reftests/box-shadow/reftest.list @@ -25,6 +25,7 @@ random-if(d2d) == boxshadow-threecorners.html boxshadow-threecorners-ref.html fuzzy-if(OSX==1010,1,24) == boxshadow-large-border-radius.html boxshadow-large-border-radius-ref.html # Bug 1209649 == boxshadow-border-radius-int.html boxshadow-border-radius-int-ref.html == boxshadow-inset-neg-spread.html about:blank +== boxshadow-inset-neg-spread2.html boxshadow-inset-neg-spread2-ref.html fuzzy(26,3610) == boxshadow-rotated.html boxshadow-rotated-ref.html # Bug 1211264 == overflow-not-scrollable-1.html overflow-not-scrollable-1-ref.html @@ -34,3 +35,7 @@ fails-if(B2G||Mulet) == 611574-1.html 611574-1-ref.html # Initial mulet triage: fails-if(B2G||Mulet) == 611574-2.html 611574-2-ref.html # Initial mulet triage: parity with B2G/B2G Desktop fuzzy-if(winWidget,5,30) == fieldset.html fieldset-ref.html # minor anti-aliasing problem on Windows fuzzy-if(winWidget,5,30) == fieldset-inset.html fieldset-inset-ref.html # minor anti-aliasing problem on Windows +== 1178575.html 1178575-ref.html +== 1178575-2.html 1178575-2-ref.html +fuzzy(159,2) fails-if(!d2d) == 1212823-1.html 1212823-1-ref.html +== boxshadow-large-offset.html boxshadow-large-offset-ref.html diff --git a/layout/reftests/bugs/1202512-1-ref.html b/layout/reftests/bugs/1202512-1-ref.html new file mode 100644 index 0000000000..e182a9b5da --- /dev/null +++ b/layout/reftests/bugs/1202512-1-ref.html @@ -0,0 +1,2 @@ + +

hello

diff --git a/layout/reftests/bugs/1202512-1.html b/layout/reftests/bugs/1202512-1.html new file mode 100644 index 0000000000..3fe93aa10e --- /dev/null +++ b/layout/reftests/bugs/1202512-1.html @@ -0,0 +1,13 @@ + + + +

hello

+ diff --git a/layout/reftests/bugs/1202512-2-ref.html b/layout/reftests/bugs/1202512-2-ref.html new file mode 100644 index 0000000000..c0d5c8ebe2 --- /dev/null +++ b/layout/reftests/bugs/1202512-2-ref.html @@ -0,0 +1,2 @@ + +

diff --git a/layout/reftests/bugs/1202512-2.html b/layout/reftests/bugs/1202512-2.html new file mode 100644 index 0000000000..44a4125f8e --- /dev/null +++ b/layout/reftests/bugs/1202512-2.html @@ -0,0 +1,13 @@ + + + +

+ diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index c2832ebd9c..a74e2b1bd8 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1933,6 +1933,8 @@ fuzzy(1,74) fuzzy-if(gtkWidget,6,79) == 1174332-1.html 1174332-1-ref.html == 1179078-1.html 1179078-1-ref.html == 1179288-1.html 1179288-1-ref.html == 1190635-1.html 1190635-1-ref.html +== 1202512-1.html 1202512-1-ref.html +== 1202512-2.html 1202512-2-ref.html != 1207326-1.html about:blank == 1209603-1.html 1209603-1-ref.html == 1209994-1.html 1209994-1-ref.html diff --git a/layout/reftests/css-break/box-decoration-break-with-bidi-ref.html b/layout/reftests/css-break/box-decoration-break-with-bidi-ref.html new file mode 100644 index 0000000000..976d5b5ce9 --- /dev/null +++ b/layout/reftests/css-break/box-decoration-break-with-bidi-ref.html @@ -0,0 +1,74 @@ + + + + + Testing box-decoration-break with bidi resolution + + + + + +
+
+


+
+


+
+


+
+


+
+


+
+


+
+


+ + +
+ +
+


+
+


+
+


+
+


+
+


+
+


+
+


+ +
+ + + diff --git a/layout/reftests/css-break/box-decoration-break-with-bidi.html b/layout/reftests/css-break/box-decoration-break-with-bidi.html new file mode 100644 index 0000000000..1dec2105f6 --- /dev/null +++ b/layout/reftests/css-break/box-decoration-break-with-bidi.html @@ -0,0 +1,64 @@ + + + + + Testing box-decoration-break with bidi resolution + + + + + + + +
+



+



+



+



+



+



+



+ +
+ +
+ +



+



+



+



+



+



+



+ +
+
+ + + diff --git a/layout/reftests/css-break/reftest.list b/layout/reftests/css-break/reftest.list index 0c82a762ab..0d5a6a3ad5 100644 --- a/layout/reftests/css-break/reftest.list +++ b/layout/reftests/css-break/reftest.list @@ -8,3 +8,4 @@ random-if(!gtkWidget) HTTP(..) == box-decoration-break-border-image.html box-dec == box-decoration-break-block-margin.html box-decoration-break-block-margin-ref.html fuzzy-if(!Android,1,5) fuzzy-if(Android,8,6627) == box-decoration-break-first-letter.html box-decoration-break-first-letter-ref.html == box-decoration-break-bug-1249913.html box-decoration-break-bug-1249913-ref.html +== box-decoration-break-with-bidi.html box-decoration-break-with-bidi-ref.html diff --git a/layout/reftests/css-gradients/1224761-1-ref.html b/layout/reftests/css-gradients/1224761-1-ref.html new file mode 100644 index 0000000000..7b243c9a45 --- /dev/null +++ b/layout/reftests/css-gradients/1224761-1-ref.html @@ -0,0 +1,37 @@ + + + + + + + You shouldn't see a gradual gradient in any of the divs below. +
+
+
+
+
+ + diff --git a/layout/reftests/css-gradients/1224761-1.html b/layout/reftests/css-gradients/1224761-1.html new file mode 100644 index 0000000000..97e00f7dd6 --- /dev/null +++ b/layout/reftests/css-gradients/1224761-1.html @@ -0,0 +1,36 @@ + + + + + + + You shouldn't see a gradual gradient in any of the divs below. +
+
+
+
+
+ + diff --git a/layout/reftests/css-gradients/reftest.list b/layout/reftests/css-gradients/reftest.list index 8c2d78a27f..677139654d 100644 --- a/layout/reftests/css-gradients/reftest.list +++ b/layout/reftests/css-gradients/reftest.list @@ -150,3 +150,4 @@ fuzzy(1,800000) == large-gradient-1.html large-gradient-1-ref.html == large-gradient-2.html large-gradient-2-ref.html fails-if(browserIsRemote&&!B2G) fuzzy-if(!browserIsRemote||B2G,1,800000) == large-gradient-3.html large-gradient-3-ref.html == large-gradient-4.html large-gradient-4-ref.html +== 1224761-1.html 1224761-1-ref.html diff --git a/layout/reftests/css-grid/grid-abspos-items-001-ref.html b/layout/reftests/css-grid/grid-abspos-items-001-ref.html index 0fc6afed8d..a036134450 100644 --- a/layout/reftests/css-grid/grid-abspos-items-001-ref.html +++ b/layout/reftests/css-grid/grid-abspos-items-001-ref.html @@ -48,7 +48,7 @@ body,html { color:black; background:white; font-size:16px; padding:0; margin:0; width: 112px; height: 82px; } .d { - left: 1px; top: 27px; + left: 1px; top: 20px; width: 5px; height: 1px; } .e { diff --git a/layout/reftests/css-grid/grid-abspos-items-002-ref.html b/layout/reftests/css-grid/grid-abspos-items-002-ref.html index f084d630ca..9be7f8adf5 100644 --- a/layout/reftests/css-grid/grid-abspos-items-002-ref.html +++ b/layout/reftests/css-grid/grid-abspos-items-002-ref.html @@ -49,7 +49,7 @@ body,html { color:black; background:white; font-size:16px; padding:0; margin:0; width: 112px; height: 82px; } .d { - left: 1px; top: 27px; + left: 1px; top: 20px; width: 5px; height: 1px; } .e { diff --git a/layout/reftests/css-grid/grid-abspos-items-011-ref.html b/layout/reftests/css-grid/grid-abspos-items-011-ref.html new file mode 100644 index 0000000000..55ddb6da8b --- /dev/null +++ b/layout/reftests/css-grid/grid-abspos-items-011-ref.html @@ -0,0 +1,82 @@ + + + + + CSS Grid Test: abs pos areas in empty grid + + + + + +There should be no red areas. +
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+ +
+
+ + +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+
+ + + diff --git a/layout/reftests/css-grid/grid-abspos-items-011.html b/layout/reftests/css-grid/grid-abspos-items-011.html new file mode 100644 index 0000000000..5706998fef --- /dev/null +++ b/layout/reftests/css-grid/grid-abspos-items-011.html @@ -0,0 +1,97 @@ + + + + + CSS Grid Test: abs pos areas in empty grid + + + + + + + +There should be no red areas. +
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+ +
+
+ + + + +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+
+ + + diff --git a/layout/reftests/css-grid/grid-auto-min-sizing-definite-001-ref.html b/layout/reftests/css-grid/grid-auto-min-sizing-definite-001-ref.html index 58aba6fb5e..415de6b71f 100644 --- a/layout/reftests/css-grid/grid-auto-min-sizing-definite-001-ref.html +++ b/layout/reftests/css-grid/grid-auto-min-sizing-definite-001-ref.html @@ -68,7 +68,7 @@ w { border-width: 1px 0 0 3px; border-style: solid; height:45px; - width:48px; + width:60px; left:-3px; top:-1px; } .v > w { diff --git a/layout/reftests/css-grid/grid-col-max-sizing-max-content-001.html b/layout/reftests/css-grid/grid-col-max-sizing-max-content-001.html index 5f31debf1c..ee87346873 100644 --- a/layout/reftests/css-grid/grid-col-max-sizing-max-content-001.html +++ b/layout/reftests/css-grid/grid-col-max-sizing-max-content-001.html @@ -18,6 +18,7 @@ body,html { color:black; background:white; font-size:16px; padding:0; margin:0; border: dashed blue; float:left; clear:left; + justify-items: stretch; } .c1 { grid-column: 1 / span 2; min-width:40px; } @@ -30,7 +31,6 @@ span { border-width: 1px 3px 5px 7px; padding: 1px 3px; margin: 1px 5px; - justify-self: flex-start; } x { display:inline-block; width:10px; height:18px; } diff --git a/layout/reftests/css-grid/grid-col-max-sizing-max-content-002.html b/layout/reftests/css-grid/grid-col-max-sizing-max-content-002.html index 9998c5b69f..9aaa8c0340 100644 --- a/layout/reftests/css-grid/grid-col-max-sizing-max-content-002.html +++ b/layout/reftests/css-grid/grid-col-max-sizing-max-content-002.html @@ -28,7 +28,6 @@ span { border-width: 1px 3px 5px 7px; padding: 1px 3px; margin: 1px 5px; - justify-self: flex-start; } x { display:inline-block; width:10px; height:18px; } diff --git a/layout/reftests/css-grid/grid-item-align-001-ref.html b/layout/reftests/css-grid/grid-item-align-001-ref.html index 359baacd40..35bb263ac7 100644 --- a/layout/reftests/css-grid/grid-item-align-001-ref.html +++ b/layout/reftests/css-grid/grid-item-align-001-ref.html @@ -67,92 +67,88 @@ abs4 { display:none; } } .aend,.aflexend { offset-block-start: 9px; } -.acenter { offset-block-start: 5px; } +.acenter { offset-block-start: 5px; margin-block-start:2px; } .hl .astretch2, .hr .astretch2 { height: 15px; } .hl .astretch3, .hr .astretch3 { height: 15px; } -.hl .astretch4, .hr .astretch4 { width: 27px; } .astretch2 { width:13px; height:auto; } .astretch3 { height:auto; } -.astretch4 { width:auto; } -.astretch5 { width:auto; max-width:13px; } +.astretch4 { width:0; } +.astretch5 { width:0; } .astretch6 { height:9px; } -.astretch7 { width:auto; height:auto; max-width:13px; height:9px; } +.astretch7 { width:0; height:9px; } .hl .hr {margin-left:4px;} .hl .vl {offset-block-start: 1px; offset-inline-start:3px;} .hl .vl.aend, .hl .vl.aflexend { margin-top: 7px; } -.hl .vl.acenter { margin-top:3px; } -.hl .vl.astretch4, .hl .vr.astretch4, .hl .vlr.astretch4, .hl .vrl.astretch4 { width:0; } +.hl .vl.acenter { margin-top:4px; } .hl .vr {margin-left:6px; margin-top:3px; } .hl .vr.aend, .hl .vr.aflexend {margin-left:12px; margin-top:9px; } -.hl .vr.acenter {margin-left:8px; margin-top:5px; } +.hl .vr.acenter {margin-left:8px; margin-top:6px; } .hl .vlr { margin-left:0px; margin-top:5px; } .hl .vlr.aend, .hl .vlr.aflexend {margin-left:-6px; margin-top:11px; } -.hl .vlr.acenter {margin-left:-2px; margin-top:7px; } +.hl .vlr.acenter {margin-left:-2px; margin-top:8px; } .hl .vrl { margin-left:6px; margin-top:3px; } .hl .vrl.aend, .hl .vrl.aflexend {margin-left:12px; margin-top:9px; } -.hl .vrl.acenter {margin-left:8px; margin-top:5px; } +.hl .vrl.acenter {margin-left:8px; margin-top:6px; } .hr .hl {margin-right:3px} .hr .vl {margin-right:5px; margin-top:5px; } .hr .vl.aend, .hr .vl.aflexend {margin-right:11px; margin-top:11px; } -.hr .vl.acenter {margin-right:7px; margin-top:7px; } -.hr .vl.astretch4, .hr .vr.astretch4, .hr .vlr.astretch4, .hr .vrl.astretch4 { width:0; } +.hr .vl.acenter {margin-right:7px; margin-top:8px; } .hr .vr {margin-top:5px; margin-right:-1px; } .hr .vr.aend, .hr .vr.aflexend {margin-top:11px; margin-right:-7px; } -.hr .vr.acenter {margin-top:7px; margin-right:-3px; } +.hr .vr.acenter {margin-top:8px; margin-right:-3px; } .hr .vr.astretch6, .hr .vr.astretch7 { margin-right:-1px; } .hr .vlr {margin-top:5px; margin-right:5px; } .hr .vlr.aend, .hr .vlr.aflexend {margin-top:11px; margin-right:11px; } -.hr .vlr.acenter {margin-top:7px; margin-right:7px; } +.hr .vlr.acenter {margin-top:8px; margin-right:7px; } .hr .vrl {margin-top:3px; margin-right:-1px; } .hr .vrl.aend, .hr .vrl.aflexend {margin-top:9px; margin-right:-7px; } -.hr .vrl.acenter {margin-top:5px; margin-right:-3px; } +.hr .vrl.acenter {margin-top:6px; margin-right:-3px; } .vl span { offset-block-start: 1px; offset-inline-start: 3px; } -.vl .astretch4, .vl .astretch5 { width:15px; } +.vl .astretch4 { width:15px; } +.vl .astretch5 { width:13px; } .vl .hl.aend, .vl .hl.aflexend { margin-left:4px; } -.vl .hl.acenter { margin-left:1px; } -.vl .hl.astretch6, .vl .hl.astretch7 { height:0px; } +.vl .hl.acenter { margin-left:3px; margin-top:1px; } +.vl .astretch6, .vl .astretch7 { height:0px; } .vl .hr.astretch6, .vl .hr.astretch7 { height:0px; } -.vl .hl.astretch7 { width:14px; } -.vl .hr.astretch7 { width:14px; } .vl .hr { margin-left:8px; } .vl .hr.aend, .vl .hr.aflexend { margin-left:10px; } -.vl .hr.acenter { margin-left:7px; } +.vl .hr.acenter { margin-left:9px; margin-top:1px; } .vl .vl { margin-top:-1px; margin-left:4px; } .vl .vl.aend, .vl .vl.aflexend { margin-left:6px; } -.vl .vl.acenter { margin-left:3px; } -.vl .vl.astretch7, .vl .vr.astretch7, .vl .vlr.astretch7, .vl .vrl.astretch7 { width:14px; } +.vl .vl.acenter { margin-left:5px; margin-top:-1px; } +.vl .astretch7 { width:13px; } -.vl .vl.astretch2, .vl .vl.astretch3 { height:27px; } -.vl .vr.astretch2, .vl .vr.astretch3 { height:27px; } -.vl .vlr.astretch2, .vl .vlr.astretch3 { height:27px; } -.vl .vrl.astretch2, .vl .vrl.astretch3 { height:27px; } +.vl .vl.astretch2, .vl .vl.astretch3, +.vl .vr.astretch2, .vl .vr.astretch3, +.vl .vlr.astretch2, .vl .vlr.astretch3, +.vl .vrl.astretch2, .vl .vrl.astretch3 { height:0px; } .vl .vr { margin-top:-1px; margin-left:6px; } .vl .vr.aend, .vl .vr.aflexend { margin-left:8px; } -.vl .vr.acenter { margin-left:5px; } +.vl .vr.acenter { margin-left:7px; margin-top:-1px; } .vl .vlr { margin-top:5px; margin-left:4px; } .vl .vlr.aend, .vl .vlr.aflexend { margin-left:6px; } -.vl .vlr.acenter { margin-left:3px; } +.vl .vlr.acenter { margin-left:5px; } .vl .vrl { margin-top:-1px; margin-left:6px; } .vl .vrl.aend, .vl .vrl.aflexend { margin-left:8px; } -.vl .vrl.acenter { margin-left:5px; } +.vl .vrl.acenter { margin-left:7px; } diff --git a/layout/reftests/css-grid/grid-item-align-002-ref.html b/layout/reftests/css-grid/grid-item-align-002-ref.html index 07cb0e1140..73d60d4c20 100644 --- a/layout/reftests/css-grid/grid-item-align-002-ref.html +++ b/layout/reftests/css-grid/grid-item-align-002-ref.html @@ -69,21 +69,21 @@ abs4 { grid-area: 3 / 1 / 4 / 4; } .aflexend { align-self:flex-end; } .aselfstart { align-self:self-start; } .aselfend { align-self:self-end; } -.acenter { align-self:center; } +.acenter { margin-right:2px; } .aleft { align-self:left; } .aright { align-self:right; } .astretch1 { align-self:stretch; } -.astretch2 { align-self:stretch; width:13px; height:auto; } -.astretch3 { align-self:stretch; height:auto; } +.astretch2 { align-self:stretch; width:13px; height:0; } +.astretch3 { align-self:stretch; height:0; } .astretch4 { align-self:stretch; width:auto; } .astretch5 { align-self:stretch; width:auto; max-width:13px; } -.astretch6 { align-self:stretch; height:auto; max-height:9px; } -.astretch7 { align-self:stretch; width:auto; height:auto; max-width:13px; max-height:9px; } +.astretch6 { align-self:stretch; height:0; max-height:9px; } +.astretch7 { align-self:stretch; width:auto; height:0; max-width:13px; max-height:9px; } .aauto { align-self:auto; } .vr .aend, .vr .aflexend { margin-right:3px; } .vlr .aend, .vlr .aflexend { margin-left:4px; } -.vlr .acenter { margin-left:1px; } +.vlr .acenter { margin-left:3px; } .vrl .aend, .vrl .aflexend { margin-right:3px; } .astretch6 { width:13px; } diff --git a/layout/reftests/css-grid/grid-item-align-003-ref.html b/layout/reftests/css-grid/grid-item-align-003-ref.html index a8524d2fa5..3ab6ee3298 100644 --- a/layout/reftests/css-grid/grid-item-align-003-ref.html +++ b/layout/reftests/css-grid/grid-item-align-003-ref.html @@ -67,17 +67,14 @@ abs4 { right: 35px; } .true.hl.aend, .true.hl.aflexend { offset-block-start:-15px; } .true.vrl.aend, .true.vrl.aflexend { offset-inline-start:-15px; } -.true.hl.acenter { offset-block-start:-8px; } -.true.vrl.acenter { offset-inline-start:-8px; } +.true.hl.acenter { offset-block-start:-7px; } +.true.vrl.acenter { offset-inline-start:-7px; } .astretch2 { width:40px; height:15px; } .astretch3 { height:15px; } -.hl.astretch4 { width:27px; } -.vrl.astretch4 { width:0px; } -.astretch5 { width:27px; max-width:38px; } -.vrl.astretch5 { width:0px; } +.astretch4 { width:0; } +.astretch5 { width:0; max-width:38px; } .astretch6 { height:15px; max-height:30px; } -.astretch7 { width:27px; height:15px; max-width:38px; max-height:30px; } -.vrl.astretch7 { width:0px; } +.astretch7 { width:0; height:15px; max-width:38px; max-height:30px; } diff --git a/layout/reftests/css-grid/grid-item-justify-001-ref.html b/layout/reftests/css-grid/grid-item-justify-001-ref.html index 3af8fba42d..99c8536454 100644 --- a/layout/reftests/css-grid/grid-item-justify-001-ref.html +++ b/layout/reftests/css-grid/grid-item-justify-001-ref.html @@ -74,9 +74,9 @@ span { .hl .jend, .hl .jflexend, .hl .jright { margin-left: 16px; } .hr .jend, .hr .jflexend { margin-right: 15px; } -.hl .jcenter { margin-left: 7px; } +.hl .jcenter { margin-left: 9px; } .vl .jend, .vl .jflexend { margin-right:3px; } -.hr .jcenter { margin-right: 7px; } +.hr .jcenter { margin-right: 8px; } .hr .jleft { margin-right: 15px; } .hl .jstretch5, .hl .jstretch7, .hr .jstretch5, .hr .jstretch7 { width:14px; } @@ -87,7 +87,7 @@ span { .vl .jstretch2, .vl .jstretch3 { height:27px; } .vl .jstretch6, .vl .jstretch7 { height:9px; } .vl .jend, .vl .jflexend, .vl .jright { margin-top: 19px; } -.vl .jcenter { margin-top: 9px; } +.vl .jcenter { margin-top: 10px; } diff --git a/layout/reftests/css-grid/grid-item-justify-002-ref.html b/layout/reftests/css-grid/grid-item-justify-002-ref.html index 2d0f1e75da..39e7d26f0e 100644 --- a/layout/reftests/css-grid/grid-item-justify-002-ref.html +++ b/layout/reftests/css-grid/grid-item-justify-002-ref.html @@ -85,8 +85,8 @@ abs4 { grid-area: 3 / 1 / 4 / 4; } .vr .jend, .vr .jflexend, .vr .jright, .vrl .jend, .vrl .jflexend, .vrl .jright { margin-top: 19px; } .vlr .jend, .vlr .jflexend, .vlr .jleft { margin-bottom: 20px;} -.vr .jcenter, .vrl .jcenter { margin-top: 9px; } -.vlr .jcenter { margin-bottom: 9px; } +.vr .jcenter, .vrl .jcenter { margin-top: 10px; } +.vlr .jcenter { margin-bottom: 11px; } diff --git a/layout/reftests/css-grid/grid-max-sizing-flex-001.html b/layout/reftests/css-grid/grid-max-sizing-flex-001.html index d9c961f685..56adb9e681 100644 --- a/layout/reftests/css-grid/grid-max-sizing-flex-001.html +++ b/layout/reftests/css-grid/grid-max-sizing-flex-001.html @@ -18,6 +18,7 @@ body,html { color:black; background:white; font-size:16px; padding:0; margin:0; border: dashed blue; float: left; clear: left; + justify-items: stretch; } .c1 { grid-column: 1 / span 2; min-width:40px; } @@ -30,7 +31,6 @@ span { border-width: 1px 3px 5px 7px; padding: 1px 3px; margin: 1px 5px; - justify-self: flex-start; } x { display:inline-block; width:10px; height:18px; } diff --git a/layout/reftests/css-grid/grid-max-sizing-flex-002.html b/layout/reftests/css-grid/grid-max-sizing-flex-002.html index c0c541e70c..d86498207a 100644 --- a/layout/reftests/css-grid/grid-max-sizing-flex-002.html +++ b/layout/reftests/css-grid/grid-max-sizing-flex-002.html @@ -17,6 +17,7 @@ body { width: 800px; } display: grid; grid-auto-columns: minmax(0,1fr); border: dashed blue; + justify-items: stretch; } .c1 { grid-column: 1 / span 2; min-width:40px; } @@ -29,7 +30,6 @@ span { border-width: 1px 3px 5px 7px; padding: 1px 3px; margin: 1px 5px; - justify-self: flex-start; } x { display:inline-block; width:10px; height:18px; } diff --git a/layout/reftests/css-grid/grid-max-sizing-flex-003.html b/layout/reftests/css-grid/grid-max-sizing-flex-003.html index ef3ee72d9b..725f75fc5b 100644 --- a/layout/reftests/css-grid/grid-max-sizing-flex-003.html +++ b/layout/reftests/css-grid/grid-max-sizing-flex-003.html @@ -17,6 +17,7 @@ body { width: 800px; } display: grid; grid-auto-rows: minmax(0,1fr); border: 3px dashed blue; + justify-items: stretch; } .c1 { grid-row: 1 / span 2; min-height:40px; } @@ -29,7 +30,6 @@ span { border-height: 1px 3px 5px 7px; padding: 1px 3px; margin: 1px 5px; - justify-self: flex-start; } x { display:inline-block; height:10px; width:18px; } diff --git a/layout/reftests/css-grid/grid-max-sizing-flex-004.html b/layout/reftests/css-grid/grid-max-sizing-flex-004.html index 0ff596f54f..dd3813b516 100644 --- a/layout/reftests/css-grid/grid-max-sizing-flex-004.html +++ b/layout/reftests/css-grid/grid-max-sizing-flex-004.html @@ -49,7 +49,6 @@ span { background: gray; border-style: solid; border-width: 1px 3px 5px 7px; - justify-self: flex-start; } x { display:inline-block; height:10px; width:18px; } diff --git a/layout/reftests/css-grid/grid-placement-abspos-implicit-001-ref.html b/layout/reftests/css-grid/grid-placement-abspos-implicit-001-ref.html index ae720880b7..c01334985b 100644 --- a/layout/reftests/css-grid/grid-placement-abspos-implicit-001-ref.html +++ b/layout/reftests/css-grid/grid-placement-abspos-implicit-001-ref.html @@ -45,7 +45,7 @@ body,html { color:black; background:white; font-size:16px; padding:0; margin:0; width: 51px; height: 2px; } .d { - left: 1px; top: 18px; + left: 1px; top: 11px; width: 212px; height: 1px; } .e { @@ -98,7 +98,7 @@ span {
-d +d
diff --git a/layout/reftests/css-grid/grid-placement-auto-col-dense-001-ref.html b/layout/reftests/css-grid/grid-placement-auto-col-dense-001-ref.html index f57d5caf98..ddaec606f9 100644 --- a/layout/reftests/css-grid/grid-placement-auto-col-dense-001-ref.html +++ b/layout/reftests/css-grid/grid-placement-auto-col-dense-001-ref.html @@ -1,14 +1,27 @@ + - - - + + + +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ + + +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ + + diff --git a/layout/reftests/css-grid/grid-placement-implicit-named-areas-001.html b/layout/reftests/css-grid/grid-placement-implicit-named-areas-001.html new file mode 100644 index 0000000000..8f73dfb9b6 --- /dev/null +++ b/layout/reftests/css-grid/grid-placement-implicit-named-areas-001.html @@ -0,0 +1,159 @@ + + + + + CSS Grid Test: implicit named areas + + + + + + + +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ + + +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ + + diff --git a/layout/reftests/css-grid/reftest.list b/layout/reftests/css-grid/reftest.list index 2122cbae02..ca368dc8fb 100644 --- a/layout/reftests/css-grid/reftest.list +++ b/layout/reftests/css-grid/reftest.list @@ -10,6 +10,7 @@ fails == grid-whitespace-handling-1b.xhtml grid-whitespace-handling-1-ref.xhtml == grid-placement-auto-row-dense-001.html grid-placement-auto-row-dense-001-ref.html == grid-placement-auto-col-sparse-001.html grid-placement-auto-col-sparse-001-ref.html == grid-placement-auto-col-dense-001.html grid-placement-auto-col-dense-001-ref.html +== grid-placement-implicit-named-areas-001.html grid-placement-implicit-named-areas-001-ref.html == grid-track-sizing-001.html grid-track-sizing-001-ref.html == grid-abspos-items-001.html grid-abspos-items-001-ref.html == grid-abspos-items-002.html grid-abspos-items-002-ref.html @@ -21,6 +22,7 @@ fails == grid-whitespace-handling-1b.xhtml grid-whitespace-handling-1-ref.xhtml == grid-abspos-items-008.html grid-abspos-items-008-ref.html == grid-abspos-items-009.html grid-abspos-items-009-ref.html == grid-abspos-items-010.html grid-abspos-items-010-ref.html +== grid-abspos-items-011.html grid-abspos-items-011-ref.html == grid-abspos-items-012.html grid-abspos-items-012-ref.html == grid-order-abspos-items-001.html grid-order-abspos-items-001-ref.html == grid-order-placement-auto-001.html grid-order-placement-auto-001-ref.html diff --git a/layout/reftests/css-parsing/reftest.list b/layout/reftests/css-parsing/reftest.list index 054783456d..bc869a1cfe 100644 --- a/layout/reftests/css-parsing/reftest.list +++ b/layout/reftests/css-parsing/reftest.list @@ -5,3 +5,4 @@ == at-rule-error-handling-import-1.html at-rule-error-handling-ref.html == at-rule-error-handling-media-1.html at-rule-error-handling-ref.html == invalid-font-face-descriptor-1.html invalid-font-face-descriptor-1-ref.html +== two-dash-identifiers.html two-dash-identifiers-ref.html diff --git a/layout/reftests/css-parsing/two-dash-identifiers-ref.html b/layout/reftests/css-parsing/two-dash-identifiers-ref.html new file mode 100644 index 0000000000..b6ffdbb01e --- /dev/null +++ b/layout/reftests/css-parsing/two-dash-identifiers-ref.html @@ -0,0 +1,12 @@ + + +
This should be green.
+
This should be green.
+
This should be green.
+
This should be green.
+
This should be green.
+
This should be green.
+
This should be green.
+
This should be green.
diff --git a/layout/reftests/css-parsing/two-dash-identifiers.html b/layout/reftests/css-parsing/two-dash-identifiers.html new file mode 100644 index 0000000000..9ea7854b92 --- /dev/null +++ b/layout/reftests/css-parsing/two-dash-identifiers.html @@ -0,0 +1,22 @@ + + +
This should be green.
+
This should be green.
+
This should be green.
+
This should be green.
+
This should be green.
+
This should be green.
+
This should be green.
+
This should be green.
diff --git a/layout/reftests/reftest.list b/layout/reftests/reftest.list index 104f0fed51..ea321737bd 100644 --- a/layout/reftests/reftest.list +++ b/layout/reftests/reftest.list @@ -376,6 +376,9 @@ include ../xul/reftest/reftest.list # xul grid include ../xul/grid/reftests/reftest.list +# -webkit-gradient expressions +include webkit-gradient/reftest.list + # writing-mode include writing-mode/reftest.list diff --git a/layout/reftests/webkit-gradient/reftest.list b/layout/reftests/webkit-gradient/reftest.list new file mode 100644 index 0000000000..0f822256d8 --- /dev/null +++ b/layout/reftests/webkit-gradient/reftest.list @@ -0,0 +1,21 @@ +# This directory contains tests for -webkit-gradient() expressions. +# They require webkit prefix support to be enabled. +default-preferences pref(layout.css.prefixes.webkit,true) + +# Tests where we don't render a "-webkit-gradient" exactly correctly. +# (These just ensure that our approximate/do-something rendering does not +# change unexpectedly.) +fuzzy-if(cocoaWidget,3,3369) == webkit-gradient-approx-linear-1.html webkit-gradient-approx-linear-1-ref.html # bug 1225372 +== webkit-gradient-approx-radial-1.html webkit-gradient-approx-radial-1-ref.html + +# Tests for -webkit-gradient(linear, ...) +== webkit-gradient-linear-1a.html webkit-gradient-linear-1-ref.html +== webkit-gradient-linear-1b.html webkit-gradient-linear-1-ref.html +== webkit-gradient-linear-1c.html webkit-gradient-linear-1-ref.html +== webkit-gradient-linear-1d.html webkit-gradient-linear-1-ref.html +== webkit-gradient-linear-2.html webkit-gradient-linear-2-ref.html + +# Tests for -webkit-gradient(radial, ...) +== webkit-gradient-radial-1a.html webkit-gradient-radial-1-ref.html +== webkit-gradient-radial-1b.html webkit-gradient-radial-1-ref.html +== webkit-gradient-radial-2.html webkit-gradient-radial-2-ref.html diff --git a/layout/reftests/webkit-gradient/webkit-gradient-approx-linear-1-ref.html b/layout/reftests/webkit-gradient/webkit-gradient-approx-linear-1-ref.html new file mode 100644 index 0000000000..3266074402 --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-approx-linear-1-ref.html @@ -0,0 +1,68 @@ + + + + + CSS Reference + + + + +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ + + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-approx-linear-1.html b/layout/reftests/webkit-gradient/webkit-gradient-approx-linear-1.html new file mode 100644 index 0000000000..e1642b92a8 --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-approx-linear-1.html @@ -0,0 +1,73 @@ + + + + + + CSS Test: -webkit-gradient(linear, ...) expressions which we don't render + quite correctly because they can't easily be represented with modern syntax. + + + + + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ + + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-approx-radial-1-ref.html b/layout/reftests/webkit-gradient/webkit-gradient-approx-radial-1-ref.html new file mode 100644 index 0000000000..274a466206 --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-approx-radial-1-ref.html @@ -0,0 +1,62 @@ + + + + + CSS Reference + + + + + + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-approx-radial-1.html b/layout/reftests/webkit-gradient/webkit-gradient-approx-radial-1.html new file mode 100644 index 0000000000..4f0760560b --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-approx-radial-1.html @@ -0,0 +1,64 @@ + + + + + + CSS Test: -webkit-gradient(radial, ...) expressions which we don't render + quite correctly because they can't easily be represented with modern syntax. + + + + + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-linear-1-ref.html b/layout/reftests/webkit-gradient/webkit-gradient-linear-1-ref.html new file mode 100644 index 0000000000..d86354584e --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-linear-1-ref.html @@ -0,0 +1,51 @@ + + + + + CSS Reference + + + + +
+ +
+
+ + +
+
+
+ + +
+ +
+
+ + +
+ +
+ + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-linear-1a.html b/layout/reftests/webkit-gradient/webkit-gradient-linear-1a.html new file mode 100644 index 0000000000..1a6fe1650b --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-linear-1a.html @@ -0,0 +1,67 @@ + + + + + + CSS Test: -webkit-gradient(linear, ...) expressions, + from center of each side to center of opposite side. + + + + + +
+ + +
+
+ + +
+
+
+ + +
+ +
+
+ + +
+ +
+ + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-linear-1b.html b/layout/reftests/webkit-gradient/webkit-gradient-linear-1b.html new file mode 100644 index 0000000000..ae03d777ab --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-linear-1b.html @@ -0,0 +1,67 @@ + + + + + + CSS Test: -webkit-gradient(linear, ...) expressions, + from the top-left-most end of each side to the + top-left-most end of opposite side. + + + + + +
+ +
+
+ + +
+
+
+ + +
+ +
+
+ + +
+ +
+ + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-linear-1c.html b/layout/reftests/webkit-gradient/webkit-gradient-linear-1c.html new file mode 100644 index 0000000000..29ae3a7862 --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-linear-1c.html @@ -0,0 +1,67 @@ + + + + + + CSS Test: -webkit-gradient(linear, ...) expressions, + from the bottom-right-most end of each side to the + bottom-right-most end of opposite side. + + + + + +
+ +
+
+ + +
+
+
+ + +
+ +
+
+ + +
+ +
+ + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-linear-1d.html b/layout/reftests/webkit-gradient/webkit-gradient-linear-1d.html new file mode 100644 index 0000000000..b1b54372ce --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-linear-1d.html @@ -0,0 +1,67 @@ + + + + + + CSS Test: -webkit-gradient(linear, ...) expressions, + from the an arbitrary spot along each side to the same arbitrary + place on opposite side. + + + + + +
+ +
+
+ + +
+
+
+ + +
+ +
+
+ + +
+ +
+ + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-linear-2-ref.html b/layout/reftests/webkit-gradient/webkit-gradient-linear-2-ref.html new file mode 100644 index 0000000000..efdf5395b7 --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-linear-2-ref.html @@ -0,0 +1,61 @@ + + + + + CSS Reference + + + + +
+ + +
+
+ + +
+
+
+
+
+ + + +
+
+
+
+
+
+ + +
+
+
+
+
+ + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-linear-2.html b/layout/reftests/webkit-gradient/webkit-gradient-linear-2.html new file mode 100644 index 0000000000..95defb5081 --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-linear-2.html @@ -0,0 +1,80 @@ + + + + + + CSS Test: -webkit-gradient(linear, ...) expressions with special cases + for color stops. + + + + + +
+ +
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+ + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-radial-1-ref.html b/layout/reftests/webkit-gradient/webkit-gradient-radial-1-ref.html new file mode 100644 index 0000000000..bb1c67aea1 --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-radial-1-ref.html @@ -0,0 +1,71 @@ + + + + + CSS Reference + + + + +
+
+ +
+
+ +
+
+
+ + +
+
+ +
+
+ +
+
+
+ + +
+
+ +
+
+ +
+
+ + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-radial-1a.html b/layout/reftests/webkit-gradient/webkit-gradient-radial-1a.html new file mode 100644 index 0000000000..24e32492f4 --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-radial-1a.html @@ -0,0 +1,114 @@ + + + + + + CSS Test: -webkit-gradient(radial, ...) expressions, + with 0-sized inner circle listed first + + + + + +
+
+ +
+
+ +
+
+
+ + +
+
+ +
+
+ +
+
+
+ + +
+
+ +
+
+ +
+
+ + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-radial-1b.html b/layout/reftests/webkit-gradient/webkit-gradient-radial-1b.html new file mode 100644 index 0000000000..08bbc0789a --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-radial-1b.html @@ -0,0 +1,114 @@ + + + + + + CSS Test: -webkit-gradient(radial, ...) expressions, + with 0-sized inner circle listed second + + + + + +
+
+ +
+
+ +
+
+
+ + +
+
+ +
+
+ +
+
+
+ + +
+
+ +
+
+ +
+
+ + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-radial-2-ref.html b/layout/reftests/webkit-gradient/webkit-gradient-radial-2-ref.html new file mode 100644 index 0000000000..c82e3dbb59 --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-radial-2-ref.html @@ -0,0 +1,49 @@ + + + + + + CSS Test: -webkit-gradient(radial, ...) expressions + with various numeric positions and/or side keywords. + + + + + +
+
+
+
+ + +
+
+
+
+ +
+
+
+ + diff --git a/layout/reftests/webkit-gradient/webkit-gradient-radial-2.html b/layout/reftests/webkit-gradient/webkit-gradient-radial-2.html new file mode 100644 index 0000000000..56e9cbb41f --- /dev/null +++ b/layout/reftests/webkit-gradient/webkit-gradient-radial-2.html @@ -0,0 +1,62 @@ + + + + + + CSS Test: -webkit-gradient(radial, ...) expressions + with various numeric positions and/or side keywords. + + + + + +
+
+
+
+ + +
+
+
+
+ +
+
+
+ + diff --git a/layout/style/RuleProcessorCache.h b/layout/style/RuleProcessorCache.h index 844a281f33..7eb808fc94 100644 --- a/layout/style/RuleProcessorCache.h +++ b/layout/style/RuleProcessorCache.h @@ -24,8 +24,8 @@ namespace mozilla { class CSSStyleSheet; namespace css { class DocumentRule; -} -} +} // namespace css +} // namespace mozilla namespace mozilla { diff --git a/layout/style/StyleRule.cpp b/layout/style/StyleRule.cpp index a53cf21853..d53479d8b4 100644 --- a/layout/style/StyleRule.cpp +++ b/layout/style/StyleRule.cpp @@ -286,6 +286,19 @@ nsAttrSelector::~nsAttrSelector(void) NS_CSS_DELETE_LIST_MEMBER(nsAttrSelector, this, mNext); } +size_t +nsAttrSelector::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const +{ + size_t n = 0; + const nsAttrSelector* p = this; + while (p) { + n += aMallocSizeOf(p); + n += p->mValue.SizeOfExcludingThisIfUnshared(aMallocSizeOf); + p = p->mNext; + } + return n; +} + // -- nsCSSSelector ------------------------------- nsCSSSelector::nsCSSSelector(void) @@ -924,11 +937,8 @@ nsCSSSelector::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MEASURE(s->mClassList); MEASURE(s->mPseudoClassList); MEASURE(s->mNegations); + MEASURE(s->mAttrList); - // Measurement of the following members may be added later if DMD finds it is - // worthwhile: - // - s->mAttrList - // // The following members aren't measured: // - s->mLowercaseTag, because it's an atom and therefore shared // - s->mCasedTag, because it's an atom and therefore shared diff --git a/layout/style/StyleRule.h b/layout/style/StyleRule.h index 2217f732bf..5383854f0e 100644 --- a/layout/style/StyleRule.h +++ b/layout/style/StyleRule.h @@ -107,6 +107,8 @@ public: /** Do a deep clone. Should be used only on the first in the linked list. */ nsAttrSelector* Clone() const { return Clone(true); } + size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; + nsString mValue; nsAttrSelector* mNext; nsCOMPtr mLowercaseAttr; diff --git a/layout/style/TopLevelVideoDocument.css b/layout/style/TopLevelVideoDocument.css index 0d9cf4de79..0f6f26749a 100644 --- a/layout/style/TopLevelVideoDocument.css +++ b/layout/style/TopLevelVideoDocument.css @@ -24,6 +24,7 @@ video { margin: auto; max-width: 100%; max-height: 100%; + -moz-user-select: none; } video:focus { diff --git a/layout/style/contenteditable.css b/layout/style/contenteditable.css index efabc661b4..436ecb053d 100644 --- a/layout/style/contenteditable.css +++ b/layout/style/contenteditable.css @@ -10,7 +10,7 @@ } *|*:-moz-read-write :-moz-read-only { - -moz-user-select: all !important; + -moz-user-select: all; } *|*:-moz-read-only > :-moz-read-write { @@ -20,7 +20,7 @@ input:-moz-read-write > .anonymous-div:-moz-read-only, textarea:-moz-read-write > .anonymous-div:-moz-read-only { - -moz-user-select: text !important; + -moz-user-select: text; } /* Use default arrow over objects with size that @@ -60,7 +60,7 @@ a:link:-moz-read-write { *|*:-moz-read-write > input:-moz-read-only, *|*:-moz-read-write > button:-moz-read-only, *|*:-moz-read-write > textarea:-moz-read-only { - -moz-user-select: all !important; + -moz-user-select: all; -moz-user-input: auto !important; -moz-user-focus: none !important; } @@ -75,7 +75,7 @@ input[contenteditable="true"]:disabled, input[contenteditable="true"][type="checkbox"], input[contenteditable="true"][type="radio"], input[contenteditable="true"][type="file"] { - -moz-user-select: all !important; + -moz-user-select: all; -moz-user-input: none !important; -moz-user-focus: none !important; } @@ -96,15 +96,15 @@ input[contenteditable="true"][type="hidden"] { } label:-moz-read-write { - -moz-user-select: all !important; + -moz-user-select: all; } *|*::-moz-display-comboboxcontrol-frame { - -moz-user-select: text !important; + -moz-user-select: text; } option:-moz-read-write { - -moz-user-select: text !important; + -moz-user-select: text; } /* the following rules are for Image Resizing */ @@ -220,7 +220,7 @@ a[\_moz_anonclass="mozTableAddColumnBefore"] { background-image: url("resource://gre/res/table-add-column-before.gif"); background-repeat: no-repeat; background-position: center center; - -moz-user-select: none !important; + -moz-user-select: none; -moz-user-focus: none !important; } @@ -242,7 +242,7 @@ a[\_moz_anonclass="mozTableAddColumnAfter"] { background-image: url("resource://gre/res/table-add-column-after.gif"); background-repeat: no-repeat; background-position: center center; - -moz-user-select: none !important; + -moz-user-select: none; -moz-user-focus: none !important; } @@ -264,7 +264,7 @@ a[\_moz_anonclass="mozTableRemoveColumn"] { background-image: url("resource://gre/res/table-remove-column.gif"); background-repeat: no-repeat; background-position: center center; - -moz-user-select: none !important; + -moz-user-select: none; -moz-user-focus: none !important; } @@ -286,7 +286,7 @@ a[\_moz_anonclass="mozTableAddRowBefore"] { background-image: url("resource://gre/res/table-add-row-before.gif"); background-repeat: no-repeat; background-position: center center; - -moz-user-select: none !important; + -moz-user-select: none; -moz-user-focus: none !important; } @@ -308,7 +308,7 @@ a[\_moz_anonclass="mozTableAddRowAfter"] { background-image: url("resource://gre/res/table-add-row-after.gif"); background-repeat: no-repeat; background-position: center center; - -moz-user-select: none !important; + -moz-user-select: none; -moz-user-focus: none !important; } @@ -330,7 +330,7 @@ a[\_moz_anonclass="mozTableRemoveRow"] { background-image: url("resource://gre/res/table-remove-row.gif"); background-repeat: no-repeat; background-position: center center; - -moz-user-select: none !important; + -moz-user-select: none; -moz-user-focus: none !important; } diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index f77568daca..d5d38c7fec 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -11,6 +11,8 @@ #include "mozilla/Move.h" #include "mozilla/MathAlgorithms.h" +#include // for std::stable_sort + #include "nsCSSParser.h" #include "nsCSSProps.h" #include "nsCSSKeywords.h" @@ -39,7 +41,7 @@ #include "nsStyleUtil.h" #include "nsIPrincipal.h" #include "nsICSSUnprefixingService.h" -#include "prprf.h" +#include "mozilla/Snprintf.h" #include "nsContentUtils.h" #include "nsAutoPtr.h" #include "CSSCalc.h" @@ -1245,6 +1247,23 @@ protected: bool ParseGradientColorStops(nsCSSValueGradient* aGradient, nsCSSValue& aValue); + // For the ancient "-webkit-gradient(linear|radial, ...)" syntax: + bool ParseWebkitGradientPointComponent(nsCSSValue& aComponent, + bool aIsHorizontal); + bool ParseWebkitGradientPoint(nsCSSValuePair& aPoint); + bool ParseWebkitGradientRadius(float& aRadius); + bool ParseWebkitGradientColorStop(nsCSSValueGradient* aGradient); + bool ParseWebkitGradientColorStops(nsCSSValueGradient* aGradient); + void FinalizeLinearWebkitGradient(nsCSSValueGradient* aGradient, + const nsCSSValuePair& aStartPoint, + const nsCSSValuePair& aSecondPoint); + void FinalizeRadialWebkitGradient(nsCSSValueGradient* aGradient, + const nsCSSValuePair& aFirstCenter, + const nsCSSValuePair& aSecondCenter, + const float aFirstRadius, + const float aSecondRadius); + bool ParseWebkitGradient(nsCSSValue& aValue); + void SetParsingCompoundProperty(bool aBool) { mParsingCompoundProperty = aBool; } @@ -1629,7 +1648,7 @@ CSSParserImpl::ParseSheet(const nsAString& aInput, } mParsingMode = aParsingMode; - mIsChrome = nsContentUtils::IsSystemPrincipal(aSheetPrincipal); + mIsChrome = dom::IsChromeURI(aSheetURI); mReusableSheets = aReusableSheets; nsCSSToken* tk = &mToken; @@ -4264,9 +4283,10 @@ CSSParserImpl::ParseKeyframeRule() return nullptr; } - // Takes ownership of declaration, and steals contents of selectorList. + // Takes ownership of declaration RefPtr rule = - new nsCSSKeyframeRule(selectorList, declaration, linenum, colnum); + new nsCSSKeyframeRule(Move(selectorList), declaration.forget(), + linenum, colnum); return rule.forget(); } @@ -6426,7 +6446,7 @@ CSSParserImpl::ParseDeclarationBlock(uint32_t aFlags, nsCSSContextType aContext) RefPtr declaration = new css::Declaration(); mData.AssertInitialState(); for (;;) { - bool changed; + bool changed = false; if (!ParseDeclaration(declaration, aFlags, true, &changed, aContext)) { if (!SkipDeclaration(checkForBraces)) { break; @@ -6593,14 +6613,14 @@ CSSParserImpl::ParseColor(nsCSSValue& aValue) case eCSSToken_Number: if (tk->mIntegerValid) { - PR_snprintf(buffer, sizeof(buffer), "%06d", tk->mInteger); + snprintf_literal(buffer, "%06d", tk->mInteger); str.AssignWithConversion(buffer); } break; case eCSSToken_Dimension: if (tk->mIdent.Length() <= 6) { - PR_snprintf(buffer, sizeof(buffer), "%06.0f", tk->mNumber); + snprintf_literal(buffer, "%06.0f", tk->mNumber); nsAutoString temp; temp.AssignWithConversion(buffer); temp.Right(str, 6 - tk->mIdent.Length()); @@ -7666,6 +7686,18 @@ CSSParserImpl::ParseVariant(nsCSSValue& aValue, } return CSSParseResult::Ok; } + if ((gradientFlags == eGradient_WebkitLegacy) && + tmp.LowerCaseEqualsLiteral("gradient")) { + // Note: we check gradientFlags using '==' to select *exactly* + // eGradient_WebkitLegacy -- and exclude eGradient_Repeating -- because + // we don't want to accept -webkit-repeating-gradient() expressions. + // (This is not a recognized syntax.) + if (!ParseWebkitGradient(aValue)) { + return CSSParseResult::Error; + } + return CSSParseResult::Ok; + } + if (ShouldUseUnprefixingService() && !gradientFlags && StringBeginsWith(tmp, NS_LITERAL_STRING("-webkit-"))) { @@ -10032,7 +10064,466 @@ CSSParserImpl::ParseGradientColorStops(nsCSSValueGradient* aGradient, return true; } -int32_t +// Parses the x or y component of a -webkit-gradient() expression. +// See ParseWebkitGradientPoint() documentation for more. +bool +CSSParserImpl::ParseWebkitGradientPointComponent(nsCSSValue& aComponent, + bool aIsHorizontal) +{ + if (!GetToken(true)) { + return false; + } + + // Keyword tables to use for keyword-matching + // (Keyword order is important; we assume the index can be multiplied by 50% + // to convert to a percent-valued component.) + static const nsCSSKeyword kHorizKeywords[] = { + eCSSKeyword_left, // 0% + eCSSKeyword_center, // 50% + eCSSKeyword_right // 100% + }; + static const nsCSSKeyword kVertKeywords[] = { + eCSSKeyword_top, // 0% + eCSSKeyword_center, // 50% + eCSSKeyword_bottom // 100% + }; + static const size_t kNumKeywords = MOZ_ARRAY_LENGTH(kHorizKeywords); + static_assert(kNumKeywords == MOZ_ARRAY_LENGTH(kVertKeywords), + "Horizontal & vertical keyword tables must have same count"); + + // Try to parse the component as a number, or a percent, or a + // keyword-converted-to-percent. + if (mToken.mType == eCSSToken_Number) { + aComponent.SetFloatValue(mToken.mNumber, eCSSUnit_Pixel); + } else if (mToken.mType == eCSSToken_Percentage) { + aComponent.SetPercentValue(mToken.mNumber); + } else if (mToken.mType == eCSSToken_Ident) { + nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(mToken.mIdent); + if (keyword == eCSSKeyword_UNKNOWN) { + return false; + } + // Choose our keyword table: + const nsCSSKeyword* kwTable = aIsHorizontal ? kHorizKeywords : kVertKeywords; + // Convert keyword to percent value (0%, 50%, or 100%) + bool didAcceptKeyword = false; + for (size_t i = 0; i < kNumKeywords; i++) { + if (keyword == kwTable[i]) { + // 0%, 50%, or 100%: + aComponent.SetPercentValue(i * 0.5); + didAcceptKeyword = true; + break; + } + } + if (!didAcceptKeyword) { + return false; + } + } else { + // Unrecognized token type. Put it back. (It might be a closing-paren of an + // invalid -webkit-gradient(...) expression, and we need to be sure caller + // can see it & stops parsing at that point.) + UngetToken(); + return false; + } + + MOZ_ASSERT(aComponent.GetUnit() == eCSSUnit_Pixel || + aComponent.GetUnit() == eCSSUnit_Percent, + "If we get here, we should've successfully parsed a number (as a " + "pixel length), a percent, or a keyword (converted to percent)"); + return true; +} + +// This function parses a "" expression for -webkit-gradient(...) +// Quoting https://www.webkit.org/blog/175/introducing-css-gradients/ : +// "A point is a pair of space-separated values. +// The syntax supports numbers, percentages or +// the keywords top, bottom, left and right +// for point values." +// +// Two additional notes: +// - WebKit also accepts the "center" keyword (not listed in the text above). +// - WebKit only accepts horizontal-flavored keywords (left/center/right) in +// the first ("x") component, and vertical-flavored keywords +// (top/center/bottom) in the second ("y") component. (This is different +// from the standard gradient syntax, which accepts both orderings, e.g. +// "top left" as well as "left top".) +bool +CSSParserImpl::ParseWebkitGradientPoint(nsCSSValuePair& aPoint) +{ + return ParseWebkitGradientPointComponent(aPoint.mXValue, true) && + ParseWebkitGradientPointComponent(aPoint.mYValue, false); +} + +// Parse the next token as a (for a in a -webkit-gradient +// expresison). Returns true on success; returns false & puts back +// whatever it parsed on failure. +bool +CSSParserImpl::ParseWebkitGradientRadius(float& aRadius) +{ + if (!GetToken(true)) { + return false; + } + + if (mToken.mType != eCSSToken_Number) { + UngetToken(); + return false; + } + + aRadius = mToken.mNumber; + return true; +} + +// Parse one of: +// color-stop(number|percent, color) +// from(color) +// to(color) +// +// Quoting https://www.webkit.org/blog/175/introducing-css-gradients/ : +// A stop is a function, color-stop, that takes two arguments, the stop value +// (either a percentage or a number between 0 and 1.0), and a color (any +// valid CSS color). In addition the shorthand functions from and to are +// supported. These functions only require a color argument and are +// equivalent to color-stop(0, ...) and color-stop(1.0, …) respectively. +bool +CSSParserImpl::ParseWebkitGradientColorStop(nsCSSValueGradient* aGradient) +{ + MOZ_ASSERT(aGradient, "null gradient"); + + if (!GetToken(true)) { + return false; + } + + // We're expecting color-stop(...), from(...), or to(...) which are all + // functions. Bail if we got anything else. + if (mToken.mType != eCSSToken_Function) { + UngetToken(); + return false; + } + + nsCSSValueGradientStop* stop = aGradient->mStops.AppendElement(); + + // Parse color-stop location (or infer it, for shorthands "from"/"to"): + if (mToken.mIdent.LowerCaseEqualsLiteral("color-stop")) { + // Parse stop location, followed by comma. + if (!ParseSingleTokenVariant(stop->mLocation, + VARIANT_NUMBER | VARIANT_PERCENT, + nullptr) || + !ExpectSymbol(',', true)) { + SkipUntil(')'); // Skip to end of color-stop(...) expression. + return false; + } + + // If we got a , convert it to percentage for consistency: + if (stop->mLocation.GetUnit() == eCSSUnit_Number) { + stop->mLocation.SetPercentValue(stop->mLocation.GetFloatValue()); + } + } else if (mToken.mIdent.LowerCaseEqualsLiteral("from")) { + // Shorthand for color-stop(0%, ...) + stop->mLocation.SetPercentValue(0.0f); + } else if (mToken.mIdent.LowerCaseEqualsLiteral("to")) { + // Shorthand for color-stop(100%, ...) + stop->mLocation.SetPercentValue(1.0f); + } else { + // Unrecognized function name (invalid for a -webkit-gradient color stop). + UngetToken(); + return false; + } + + CSSParseResult result = ParseVariant(stop->mColor, VARIANT_COLOR, nullptr); + if (result != CSSParseResult::Ok || + (stop->mColor.GetUnit() == eCSSUnit_EnumColor && + stop->mColor.GetIntValue() == NS_COLOR_CURRENTCOLOR)) { + // Parse failure, or parsed "currentColor" which is forbidden in + // -webkit-gradient for some reason. + SkipUntil(')'); + return false; + } + + // Parse color-stop function close-paren + if (!ExpectSymbol(')', true)) { + SkipUntil(')'); + return false; + } + + MOZ_ASSERT(stop->mLocation.GetUnit() == eCSSUnit_Percent, + "Should produce only percent-valued stop-locations. " + "(Caller depends on this when sorting color stops.)"); + + return true; +} + +// Comparatison function to use for sorting -webkit-gradient() stops by +// location. This function assumes stops have percent-valued locations (and +// CSSParserImpl::ParseWebkitGradientColorStop should enforce this). +static bool +IsColorStopPctLocationLessThan(const nsCSSValueGradientStop& aStop1, + const nsCSSValueGradientStop& aStop2) { + return (aStop1.mLocation.GetPercentValue() < + aStop2.mLocation.GetPercentValue()); +} + +// This function parses a list of comma-separated color-stops for a +// -webkit-gradient(...) expression, and then pads & sorts the list as-needed. +bool +CSSParserImpl::ParseWebkitGradientColorStops(nsCSSValueGradient* aGradient) +{ + MOZ_ASSERT(aGradient, "null gradient"); + + // Parse any number of ", " expressions. (0 or more) + // Note: This is different from unprefixed gradient syntax, which + // requires at least 2 stops. + while (ExpectSymbol(',', true)) { + if (!ParseWebkitGradientColorStop(aGradient)) { + return false; + } + } + + // Pad up to 2 stops as-needed: + // (Modern gradient expressions are required to have at least 2 stops, so we + // depend on this internally -- e.g. we have an assertion about this in + // nsCSSRendering.cpp. -webkit-gradient syntax allows 0 stops or 1 stop, + // though, so we just pad up to 2 stops in this case). + + // If we have no stops, pad with transparent-black: + if (aGradient->mStops.IsEmpty()) { + nsCSSValueGradientStop* stop1 = aGradient->mStops.AppendElement(); + stop1->mColor.SetIntegerColorValue(NS_RGBA(0, 0, 0, 0), + eCSSUnit_RGBAColor); + nsCSSValueGradientStop* stop2 = aGradient->mStops.AppendElement(); + stop2->mColor.SetIntegerColorValue(NS_RGBA(0, 0, 0, 0), + eCSSUnit_RGBAColor); + } else if (aGradient->mStops.Length() == 1) { + // Copy whatever the author provided in the first stop: + nsCSSValueGradientStop* stop = aGradient->mStops.AppendElement(); + *stop = aGradient->mStops[0]; + } else { + // We have >2 stops. Sort them in order of increasing location. + std::stable_sort(aGradient->mStops.begin(), + aGradient->mStops.end(), + IsColorStopPctLocationLessThan); + } + return true; +} + +// Compares aStartCoord to aEndCoord, and returns true iff they share the same +// unit (both pixel, or both percent) and aStartCoord is larger. +static bool +IsWebkitGradientCoordLarger(const nsCSSValue& aStartCoord, + const nsCSSValue& aEndCoord) +{ + if (aStartCoord.GetUnit() == eCSSUnit_Percent && + aEndCoord.GetUnit() == eCSSUnit_Percent) { + return aStartCoord.GetPercentValue() > aEndCoord.GetPercentValue(); + } + + if (aStartCoord.GetUnit() == eCSSUnit_Pixel && + aEndCoord.GetUnit() == eCSSUnit_Pixel) { + return aStartCoord.GetFloatValue() > aEndCoord.GetFloatValue(); + } + + // We can't compare them, since their units differ. Returning false suggests + // that aEndCoord is larger, which is probably a decent guess anyway. + return false; +} + +// Finalize our internal representation of a -webkit-gradient(linear, ...) +// expression, given the parsed points. (The parsed color stops +// should already be hanging off of the passed-in nsCSSValueGradient.) +// +// Note: linear gradients progress along a line between two points. The +// -webkit-gradient(linear, ...) syntax lets the author precisely specify the +// starting and ending point. However, our internal gradient structures +// only store one point, and the other point is implicitly its reflection +// across the painted area's center. (The legacy -moz-linear-gradient syntax +// also lets us store an angle.) +// +// In this function, we try to go from the two-point representation to an +// equivalent or approximately-equivalent one-point representation. +void +CSSParserImpl::FinalizeLinearWebkitGradient(nsCSSValueGradient* aGradient, + const nsCSSValuePair& aStartPoint, + const nsCSSValuePair& aEndPoint) +{ + MOZ_ASSERT(!aGradient->mIsRadial, "passed-in gradient must be linear"); + + // If the start & end points have the same Y-coordinate, then we can treat + // this as a horizontal gradient progressing towards the center of the left + // or right side. + if (aStartPoint.mYValue == aEndPoint.mYValue) { + aGradient->mBgPos.mYValue.SetIntValue(NS_STYLE_BG_POSITION_CENTER, + eCSSUnit_Enumerated); + if (IsWebkitGradientCoordLarger(aStartPoint.mXValue, aEndPoint.mXValue)) { + aGradient->mBgPos.mXValue.SetIntValue(NS_STYLE_BG_POSITION_LEFT, + eCSSUnit_Enumerated); + } else { + aGradient->mBgPos.mXValue.SetIntValue(NS_STYLE_BG_POSITION_RIGHT, + eCSSUnit_Enumerated); + } + return; + } + + // If the start & end points have the same X-coordinate, then we can treat + // this as a horizontal gradient progressing towards the center of the top + // or bottom side. + if (aStartPoint.mXValue == aEndPoint.mXValue) { + aGradient->mBgPos.mXValue.SetIntValue(NS_STYLE_BG_POSITION_CENTER, + eCSSUnit_Enumerated); + if (IsWebkitGradientCoordLarger(aStartPoint.mYValue, aEndPoint.mYValue)) { + aGradient->mBgPos.mYValue.SetIntValue(NS_STYLE_BG_POSITION_TOP, + eCSSUnit_Enumerated); + } else { + aGradient->mBgPos.mYValue.SetIntValue(NS_STYLE_BG_POSITION_BOTTOM, + eCSSUnit_Enumerated); + } + return; + } + + // OK, the gradient is angled, which means we likely can't represent it + // exactly in |aGradient|, without doing analysis on the two points to + // extract an angle (which we might not be able to do depending on the units + // used). For now, we'll just do something really basic -- just use the + // first point as if it were the starting point in a legacy + // -moz-linear-gradient() expression. That way, the rendered gradient will + // progress from this first point, towards the center of the covered element, + // to a reflected end point on the far side. Note that we have to use + // mIsLegacySyntax=true for this to work, because standardized (non-legacy) + // gradients place some restrictions on the reference point [namely, that it + // use percent units & be on the border of the element]. + aGradient->mIsLegacySyntax = true; + aGradient->mBgPos = aStartPoint; +} + +// Finalize our internal representation of a -webkit-gradient(radial, ...) +// expression, given the parsed points & radii. (The parsed color-stops +// should already be hanging off of the passed-in nsCSSValueGradient). +void +CSSParserImpl::FinalizeRadialWebkitGradient(nsCSSValueGradient* aGradient, + const nsCSSValuePair& aFirstCenter, + const nsCSSValuePair& aSecondCenter, + const float aFirstRadius, + const float aSecondRadius) +{ + MOZ_ASSERT(aGradient->mIsRadial, "passed-in gradient must be radial"); + + // NOTE: -webkit-gradient(radial, ...) has *two arbitrary circles*, with the + // gradient stretching between the circles' edges. In contrast, the standard + // syntax (and hence our data structures) can only represent *one* circle, + // with the gradient going from its center to its edge. To bridge this gap + // in expressiveness, we'll just see which of our two circles is smaller, and + // we'll treat that circle as if it were zero-sized and located at the center + // of the larger circle. Then, we'll be able to use the same data structures + // that we use for the standard radial-gradient syntax. + if (aSecondRadius >= aFirstRadius) { + // Second circle is larger. + aGradient->mBgPos = aSecondCenter; + aGradient->mIsExplicitSize = true; + aGradient->GetRadiusX().SetFloatValue(aSecondRadius, eCSSUnit_Pixel); + return; + } + + // First circle is larger, so we'll have it be the outer circle. + aGradient->mBgPos = aFirstCenter; + aGradient->mIsExplicitSize = true; + aGradient->GetRadiusX().SetFloatValue(aFirstRadius, eCSSUnit_Pixel); + + // For this to work properly (with the earlier color stops attached to the + // first circle), we need to also reverse the color-stop list, so that + // e.g. the author's "from" color is attached to the outer edge (the first + // circle), rather than attached to the center (the collapsed second circle). + std::reverse(aGradient->mStops.begin(), aGradient->mStops.end()); + + // And now invert the stop locations: + for (nsCSSValueGradientStop& colorStop : aGradient->mStops) { + float origLocation = colorStop.mLocation.GetPercentValue(); + colorStop.mLocation.SetPercentValue(1.0f - origLocation); + } +} + +bool +CSSParserImpl::ParseWebkitGradient(nsCSSValue& aValue) +{ + // Parse type of gradient + if (!GetToken(true)) { + return false; + } + + if (mToken.mType != eCSSToken_Ident) { + UngetToken(); // Important; the token might be ")", which we're about to + // seek to. + SkipUntil(')'); + return false; + } + + bool isRadial; + if (mToken.mIdent.LowerCaseEqualsLiteral("radial")) { + isRadial = true; + } else if (mToken.mIdent.LowerCaseEqualsLiteral("linear")) { + isRadial = false; + } else { + // Unrecognized gradient type. + SkipUntil(')'); + return false; + } + + // Parse a comma + first point: + nsCSSValuePair firstPoint; + if (!ExpectSymbol(',', true) || + !ParseWebkitGradientPoint(firstPoint)) { + SkipUntil(')'); + return false; + } + + // If radial, parse comma + first radius: + float firstRadius; + if (isRadial) { + if (!ExpectSymbol(',', true) || + !ParseWebkitGradientRadius(firstRadius)) { + SkipUntil(')'); + return false; + } + } + + // Parse a comma + second point: + nsCSSValuePair secondPoint; + if (!ExpectSymbol(',', true) || + !ParseWebkitGradientPoint(secondPoint)) { + SkipUntil(')'); + return false; + } + + // If radial, parse comma + second radius: + float secondRadius; + if (isRadial) { + if (!ExpectSymbol(',', true) || + !ParseWebkitGradientRadius(secondRadius)) { + SkipUntil(')'); + return false; + } + } + + // Construct a nsCSSValueGradient object, and parse color stops into it: + RefPtr cssGradient = + new nsCSSValueGradient(isRadial, false /* aIsRepeating */); + + if (!ParseWebkitGradientColorStops(cssGradient) || + !ExpectSymbol(')', true)) { + // Failed to parse color-stops, or found trailing junk between them & ')'. + SkipUntil(')'); + return false; + } + + // Finish building cssGradient, based on our parsed positioning/sizing info: + if (isRadial) { + FinalizeRadialWebkitGradient(cssGradient, firstPoint, secondPoint, + firstRadius, secondRadius); + } else { + FinalizeLinearWebkitGradient(cssGradient, firstPoint, secondPoint); + } + + aValue.SetGradientValue(cssGradient); + return true; +} + + int32_t CSSParserImpl::ParseChoice(nsCSSValue aValues[], const nsCSSProperty aPropIDs[], int32_t aNumIDs) { diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index aa4e7bf1d2..2abb2eaeb3 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -1855,6 +1855,7 @@ KTableEntry nsCSSProps::kTextAlignKTable[] = { { eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT }, { eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END }, { eCSSKeyword_unsafe, NS_STYLE_TEXT_ALIGN_UNSAFE }, + { eCSSKeyword_match_parent, NS_STYLE_TEXT_ALIGN_MATCH_PARENT }, { eCSSKeyword_UNKNOWN, -1 } }; @@ -1867,7 +1868,6 @@ KTableEntry nsCSSProps::kTextAlignLastKTable[] = { { eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT }, { eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END }, { eCSSKeyword_unsafe, NS_STYLE_TEXT_ALIGN_UNSAFE }, - { eCSSKeyword_match_parent, NS_STYLE_TEXT_ALIGN_MATCH_PARENT }, { eCSSKeyword_UNKNOWN, -1 } }; diff --git a/layout/style/nsCSSRuleProcessor.cpp b/layout/style/nsCSSRuleProcessor.cpp index 2acafa2fa3..9ce556bc87 100644 --- a/layout/style/nsCSSRuleProcessor.cpp +++ b/layout/style/nsCSSRuleProcessor.cpp @@ -1209,11 +1209,17 @@ InitSystemMetrics() sSystemMetrics->AppendElement(nsGkAtoms::swipe_animation_enabled); } +// On b2gdroid, make it so that we always have a physical home button from +// gecko's point of view, event if it's just the Android home button remapped. +#ifdef MOZ_B2GDROID + sSystemMetrics->AppendElement(nsGkAtoms::physical_home_button); +#else rv = LookAndFeel::GetInt(LookAndFeel::eIntID_PhysicalHomeButton, &metricResult); if (NS_SUCCEEDED(rv) && metricResult) { sSystemMetrics->AppendElement(nsGkAtoms::physical_home_button); } +#endif #ifdef XP_WIN if (NS_SUCCEEDED( @@ -1888,8 +1894,7 @@ static bool SelectorMatches(Element* aElement, // from the parent we have to be prepared to look at all parent // nodes. The language itself is encoded in the LANG attribute. nsAutoString language; - aElement->GetLang(language); - if (!language.IsEmpty()) { + if (aElement->GetLang(language)) { if (!nsStyleUtil::DashMatchCompare(language, nsDependentString(pseudoClass->u.mString), nsASCIICaseInsensitiveStringComparator())) { @@ -1929,10 +1934,8 @@ static bool SelectorMatches(Element* aElement, break; } } - - return false; } - break; + return false; case nsCSSPseudoClasses::ePseudoClass_mozBoundElement: if (aTreeMatchContext.mScopedRoot != aElement) { @@ -2414,6 +2417,11 @@ enum SelectorMatchesTreeFlags { // Whether we still have not found the closest ancestor link element and // thus have to check the current element for it. eLookForRelevantLink = 0x1, + + // Whether SelectorMatchesTree should check for, and return true upon + // finding, an ancestor element that has an eRestyle_SomeDescendants + // restyle hint pending. + eMatchOnConditionalRestyleAncestor = 0x2, }; static bool @@ -2491,6 +2499,20 @@ SelectorMatchesTree(Element* aPrevElement, if (!element) { return false; } + if ((aFlags & eMatchOnConditionalRestyleAncestor) && + element->HasFlag(ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR)) { + // If we're looking at an element that we already generated an + // eRestyle_SomeDescendants restyle hint for, then we should pretend + // that we matched here, because we don't know what the values of + // attributes on |element| were at the time we generated the + // eRestyle_SomeDescendants. This causes AttributeEnumFunc and + // HasStateDependentStyle below to generate a restyle hint for the + // change we're currently looking at, as we don't know whether the LHS + // of the selector we looked up matches or not. (We only pass in aFlags + // to cause us to look for eRestyle_SomeDescendants here under + // AttributeEnumFunc and HasStateDependentStyle.) + return true; + } const bool isRelevantLink = (aFlags & eLookForRelevantLink) && nsCSSRuleProcessor::IsLink(element); NodeMatchContext nodeContext(EventStates(), isRelevantLink); @@ -2781,7 +2803,7 @@ nsCSSRuleProcessor::HasStateDependentStyle(ElementDependentRuleProcessorData* aD aData->mTreeMatchContext, selectorFlags) && SelectorMatchesTree(aData->mElement, selector->mNext, aData->mTreeMatchContext, - SelectorMatchesTreeFlags(0))) + eMatchOnConditionalRestyleAncestor)) { hint = nsRestyleHint(hint | possibleChange); } @@ -2918,7 +2940,7 @@ AttributeEnumFunc(nsCSSSelector* aSelector, data->mTreeMatchContext, SelectorMatchesFlags::UNKNOWN) && SelectorMatchesTree(data->mElement, aSelector->mNext, data->mTreeMatchContext, - SelectorMatchesTreeFlags(0))) { + eMatchOnConditionalRestyleAncestor)) { aData->change = nsRestyleHint(aData->change | possibleChange); if (possibleChange & eRestyle_SomeDescendants) { aData->hintData.mSelectorsForDescendants.AppendElement(aRightmostSelector); diff --git a/layout/style/nsCSSRules.h b/layout/style/nsCSSRules.h index 0da583c911..4d403a76ef 100644 --- a/layout/style/nsCSSRules.h +++ b/layout/style/nsCSSRules.h @@ -378,14 +378,14 @@ class nsCSSKeyframeRule final : public mozilla::css::Rule, public nsIDOMMozCSSKeyframeRule { public: - // WARNING: Steals the contents of aKeys - nsCSSKeyframeRule(InfallibleTArray& aKeys, - mozilla::css::Declaration* aDeclaration, + // Steals the contents of aKeys, and takes the reference in Declaration + nsCSSKeyframeRule(InfallibleTArray&& aKeys, + already_AddRefed&& aDeclaration, uint32_t aLineNumber, uint32_t aColumnNumber) : mozilla::css::Rule(aLineNumber, aColumnNumber) - , mDeclaration(aDeclaration) + , mKeys(mozilla::Move(aKeys)) + , mDeclaration(mozilla::Move(aDeclaration)) { - mKeys.SwapElements(aKeys); mDeclaration->SetOwningRule(this); } private: diff --git a/layout/style/nsCSSScanner.cpp b/layout/style/nsCSSScanner.cpp index 7ba05fe7ce..f55d980e70 100644 --- a/layout/style/nsCSSScanner.cpp +++ b/layout/style/nsCSSScanner.cpp @@ -165,7 +165,7 @@ static inline bool StartsIdent(int32_t aFirstChar, int32_t aSecondChar) { return IsIdentStart(aFirstChar) || - (aFirstChar == '-' && IsIdentStart(aSecondChar)); + (aFirstChar == '-' && (aSecondChar == '-' || IsIdentStart(aSecondChar))); } /** diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 6995647fc0..66981d7783 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -5727,8 +5727,14 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, // positioned, the position value should be computed to 'absolute' per // the Fullscreen API spec. if (display->mTopLayer != NS_STYLE_TOP_LAYER_NONE && - !display->IsAbsolutelyPositionedStyle()) { - display->mPosition = NS_STYLE_POSITION_ABSOLUTE; + // XXX We currently only support fixed top layer element. But per + // spec it should check IsAbsolutelyPositionedStyle() instead. + // This should be fixed as soon as we support element + // in bug 840640. We have to restrict it now because addons may + // mess with UA-only styles and cause crashes. See bug 1230508. + display->mPosition != NS_STYLE_POSITION_FIXED) { + // XXX And we should set other values to absolute instead of fixed. + display->mPosition = NS_STYLE_POSITION_FIXED; // We cannot cache this struct because otherwise it may be used as // an aStartStruct for some other elements. conditions.SetUncacheable(); diff --git a/layout/style/viewsource.css b/layout/style/viewsource.css index 8f5b66e381..d30832b6a2 100644 --- a/layout/style/viewsource.css +++ b/layout/style/viewsource.css @@ -10,12 +10,17 @@ color: black; direction: ltr; -moz-control-character-visibility: visible; + height: 100%; } #viewsource { font-family: -moz-fixed; font-weight: normal; white-space: pre; counter-reset: line; + height: 100%; + box-sizing: border-box; + margin: 0; + padding: 8px; } #viewsource.wrap { white-space: pre-wrap; @@ -24,7 +29,7 @@ pre { font: inherit; color: inherit; - white-space: inherit; + white-space: inherit; margin: 0 0 0 5ch; } pre[id]:before, diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index bf18d9a62f..add1a4d047 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -4531,7 +4531,7 @@ SVGTextFrame::ResolvePositionsForNode(nsIContent* aContent, // Get x, y, dx, dy. SVGUserUnitList x, y, dx, dy; - element->GetAnimatedLengthListValues(&x, &y, &dx, &dy); + element->GetAnimatedLengthListValues(&x, &y, &dx, &dy, nullptr); // Get rotate. const SVGNumberList* rotate = nullptr; diff --git a/testing/web-platform/meta/html/dom/elements/global-attributes/the-lang-attribute-009.html.ini b/testing/web-platform/meta/html/dom/elements/global-attributes/the-lang-attribute-009.html.ini deleted file mode 100644 index b11ab74195..0000000000 --- a/testing/web-platform/meta/html/dom/elements/global-attributes/the-lang-attribute-009.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[the-lang-attribute-009.html] - type: testharness - [If the HTTP header contains a language declaration but the html element uses an empty lang value, the UA will not recognize the language declared in the HTTP header.] - expected: FAIL - diff --git a/testing/web-platform/meta/html/dom/elements/global-attributes/the-lang-attribute-010.html.ini b/testing/web-platform/meta/html/dom/elements/global-attributes/the-lang-attribute-010.html.ini deleted file mode 100644 index 0089342a43..0000000000 --- a/testing/web-platform/meta/html/dom/elements/global-attributes/the-lang-attribute-010.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[the-lang-attribute-010.html] - type: testharness - [If the meta Content-Language element contains a language declaration but the html element uses an empty lang value, the UA will not recognize the language declared in the meta Content-Language element.] - expected: FAIL - diff --git a/toolkit/themes/shared/in-content/info-pages.inc.css b/toolkit/themes/shared/in-content/info-pages.inc.css index 1c8f8b255b..4b2e6c21a2 100644 --- a/toolkit/themes/shared/in-content/info-pages.inc.css +++ b/toolkit/themes/shared/in-content/info-pages.inc.css @@ -1,8 +1,13 @@ +% This Source Code Form is subject to the terms of the Mozilla Public +% License, v. 2.0. If a copy of the MPL was not distributed with this +% file, You can obtain one at http://mozilla.org/MPL/2.0/. + @import url("chrome://global/skin/in-content/common.css"); /* Body and container */ body { display: flex; - box-sizing: padding-box; + flex-direction: column; + box-sizing: border-box; min-height: 100vh; padding-top: 0; padding-bottom: 0; @@ -17,9 +22,16 @@ body { max-width: 52em; } +.container.restore-chosen { + display: flex; + flex-direction: column; + flex-grow: 1; + margin: 10vh 0; +} + /* Typography */ .title { - background-image: url("chrome://browser/skin/aboutNetError_info.svg"); + background-image: url("chrome://global/skin/icons/info.svg"); background-position: left 0; background-repeat: no-repeat; background-size: 1.6em; @@ -82,8 +94,16 @@ ul { } /* Trees */ -tree { - min-height: 12em; +.tree-container { margin-top: 1.2em; + flex-grow: 1; + min-height: 12em; +} + +.tree-container > tree { + height: 100%; +} + +tree { width: 100%; -} \ No newline at end of file +}