Commit Graph

355 Commits

Author SHA1 Message Date
Jonathan Kew
29ffc728dc Bug 1358548 - Move functionality of BidiParagraphData::Init() into a constructor instead of a separate method. r=dholbert 2017-04-26 23:25:49 +01:00
Jonathan Kew
aa6af31047 Bug 1358275 - Optimize away repeated StyleContext() calls in nsBidiPresUtils::TraverseFrames. rs=dholbert 2017-04-26 23:25:49 +01:00
Jonathan Kew
dec49fa0a3 Bug 1358275 - Skip the main body of bidi-resolution for blocks that can be determined to be purely LTR content without directional overrides/embeddings. r=dholbert 2017-04-26 23:25:48 +01:00
Jonathan Kew
bfdf4b6d9c Bug 1357694 - Use AutoTArray for the array members in BidiLineData, to reduce heap allocation costs. r=dholbert 2017-04-19 20:09:32 +01:00
Ehsan Akhgari
bfd9f7a169 Bug 1352527 - Part 2: Switch nsBidiPresUtils consumers of nsBidi to use nsLayoutUtils::GetBidiEngine(); r=jfkthame 2017-04-14 02:41:55 -04:00
Mats Palmgren
9783bfcba8 Bug 1343606 - Pass the correct first child frame for the lines we're going to traverse, and reset bpd.mPrevFrame since we're starting at a new line. r=jfkthame
MozReview-Commit-ID: 77CG4u22OTt
2017-03-02 20:45:40 +01:00
L. David Baron
8cee77dd8b Bug 1340127 - Consider different bidi control/override values when deciding whether to consider a frame first or last. r=jfkthame
I believe the reordering of the first/last check across the code that
delves into letter frames is an improvement, but a currently undectable
one, since it appears that we don't currently allow ::first-letter
pseudo-elements to break across lines, even in the presence of
multi-character ::first-letters that are broken by
'word-break:break-all'.
2017-03-01 10:04:27 -08:00
Mats Palmgren
e22287d56b Bug 410857 part 4 - Stop passing around aBlockFrame just for DEBUG purposes. Introduce BidiParagraphData::mCurrentBlock for that purpose and set it to the right block continuation this time. r=jfkthame 2017-02-20 17:43:08 +01:00
Mats Palmgren
d69666eb3f Bug 410857 part 3 - Cache the PresContext instead of fetching it for every paragraph. r=jfkthame 2017-02-20 17:43:08 +01:00
Mats Palmgren
1b692f013a Bug 410857 part 1 - Traverse overflow lines too so we don't miss some text. r=jfkthame 2017-02-20 17:43:08 +01:00
Olli Pettay
1227d983ab Bug 1330226 - BidiParagraphData should allocate less, r=jfkthame 2017-01-12 22:46:23 +08:00
Nathan Froyd
f6f2de80c4 Bug 1315274 - rename mozilla::MakeRange to mozilla::IntegerRange; r=Waldo
MakeRange is just way too generic for this sort of thing.
2017-01-06 09:22:53 -05:00
Jeremy Chen
b1dad671ed Bug 1286468 followup - Fix naming issues.
MozReview-Commit-ID: C2PDA4R5k5F
2016-10-24 15:01:25 +08:00
Jeremy Chen
677ecc039d Bug 1286468 - Rename line related functions in nsBlockFrame. r=TYLin
1. Rename these functions to agree with Mozilla coding style.
2. Use singular naming instead of plural naming since each of these functions
returns an iterator pointing to a singular line.
3. Rename line() and rline() to BeginLineFrom() and RBeginLineFrom(), which
shall improve the readability.

MozReview-Commit-ID: txZjVnv9Yb
2016-10-22 19:41:05 +08:00
Jonathan Kew
8e4bfdad15 Bug 924851 - patch 2 - When ENABLE_INTL_API is true, make nsBidi into a minimal wrapper around ICU's ubidi.h functions. r=xidorn 2016-10-06 09:49:17 +01:00
Jonathan Kew
7a3cd2abcc Bug 924851 - patch 1 - Move definition of nsBidiLevel/nsBidiDirection and frame bidi properties from nsBidi.h to nsIFrame.h, in preparation for removal of nsBidi. r=xidorn 2016-10-06 09:49:14 +01:00
Jonathan Kew
a477107c95 Bug 1307842 - Remove the nsBidi::GetCharTypeAt() method and use plain GetBidiCat() instead. r=xidorn
MozReview-Commit-ID: 7vZCiIBGxXJ
2016-10-05 17:58:00 +01:00
Ravi Shankar
181d48792f Bug 1297982 - Replace NS_STYLE_BOX_DECORATION_BREAK_* with enum class; r=xidorn
MozReview-Commit-ID: 9Cli68UpKdz
2016-08-26 12:44:32 +05:30
Xidorn Quan
c92dbece89 Bug 1160847 part 4 - Remove useless lineOffset variable in nsBidiPresUtils::ResolveParagraph. r=jfkthame
MozReview-Commit-ID: 7YRIg9TmExp
2016-06-29 17:48:00 +10:00
Xidorn Quan
ac4daefb98 Bug 1160847 part 3 - Restore virtual bidi control characters for reordering. r=jfkthame
This patch mainly consists of two parts, one for resolving and the other
for reordering.

In the resolving part, the added code stores the lowest embedding level
of all bidi formatting characters precede a frame to the bidi data of
that frame when necessary.

In the reordering part, virtual frame is restored from the information
stored above before asking the bidi engine to reorder frames

Collapsing a run of continuous virtual formatting characters into one
virtual character with the lowest embedding level among them should work
because a character with a higher embedding level than either of its
neighbors should not affect the reordering result of any other part of
the sequence. (No formal proof of this theorem, though)

MozReview-Commit-ID: LQjRu0mWsZP
2016-06-29 17:47:18 +10:00
Xidorn Quan
5c7f995803 Bug 1160847 part 2 - Add glue to nsBidiPresUtils to use support for bidi isolate in nsBidi. r=jfkthame
This patch is mainly based on smontagu's wip patch. Some non-trivial differences:

* BidiParagraphData.mIsolateCount and related code are not added in this patch.
  I investigated uses of this field in the wip patch, and it seems to me none of
  them makes sense:
  1. in the fast path of nsBidiPresUtils::ResolveParagraph, if there would be
     any isolate character in the surrounding text, there must exist more than
     one runs, which indicates the isolate count condition is redundant.
  2. in handle of br frame in nsBidiPresUtils::TraverseFrames, based on my
     understanding of "CSS Writing Modes Level 3" section "2.4.4. Paragraph
     Breaks Within Embeddings and Isolates", the resolving should happen
     unconditionally.

* {control,override}Char in nsBidiPresUtils::TraverseFrames are assigned
  unconditionally when in a bidi inline container, so that we can properly
  handle it when there are continuations. I suspect this was the reason of
  regressions in dynamic reftests from the wip patch mentioned in comment 1.

MozReview-Commit-ID: LUdBAapA48e
2016-06-29 17:47:00 +10:00
Xidorn Quan
aff244459f Bug 1160847 part 1 - Add some debug functions. r=jfkthame
MozReview-Commit-ID: GclW6OAx6e3
2016-06-29 17:46:42 +10:00
Jonathan Kew
fa9566e585 Bug 1281424 - Don't let text-orientation:upright affect directionality in sideways-* writing modes. r=xidorn 2016-06-27 18:39:44 +01:00
Xidorn Quan
e58ba38557 Bug 1281099 part 2 - Merge three bidi frame properties into one. r=jfkthame
MozReview-Commit-ID: CEJhM3c21KO
2016-06-21 17:53:10 +10:00
Xidorn Quan
e4b1698b6a Bug 1281099 part 1 - Convert some macros to functions to help later change. r=jfkthame
MozReview-Commit-ID: 2OS5eIsNAYN
2016-06-21 17:21:09 +10:00
Jonathan Watt
9c5b8de022 Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
Cameron McCormack
f53f4c30de Bug 1266324 - Rename style const macro for unicode-bidi:bidi-override to be consistent with other style consts. r=jfkthame 2016-04-22 10:37:21 +10:00
Birunthan Mohanathas
bfee0fb40c Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Phil Ringnalda
d871b9515f Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas
245cd6a02f Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Ting-Yu Lin
60711ad8f1 Bug 1227927 Part 3 - Use ranged-based for-loop to rewrite some simple loops in part 2. r=mats 2016-01-29 22:42:15 +08:00
Ting-Yu Lin
122e5b9aeb Bug 1227927 Part 2 - Remove nsIFrame::GetFirstPrincipalChild(). r=mats 2016-01-29 22:42:14 +08:00
Xidorn Quan
c26e860288 Bug 1230034 part 6 - Convert all frame properties which do not hold pointer to be typed. r=dbaron 2016-01-28 14:23:59 +11:00
Xidorn Quan
4dccb52f19 Bug 1230034 part 3 - Move some frame property declaration around. r=dbaron 2016-01-28 14:23:59 +11:00
Nicholas Nethercote
4fab88afad Bug 1232852 (part 3) - Remove unused parameters from some accessibility code. r=tbsaunde. 2015-12-15 21:24:06 -08:00
Mats Palmgren
3cf3f60d13 Bug 1235152 - [css-break] Don't apply border/padding twice on inlines with box-decoration-break:clone and direction:rtl. r=roc 2016-01-05 21:27:13 +01:00
Nicholas Nethercote
7fabd8754f Bug 1231550 - Use DrawTarget instead of gfxContext and/or nsRenderingContext in many places in font/text code. r=jfkthame.
AutoTextRun now only needs a DrawTarget instead of an nsRenderingContext, and
similar nsRenderingContext/gfxContext-to-DrawTarget replacements can be
propagated a long way up the call graph. This patch replaces 93 occurrences of
nsRenderingContext and 135 occurrences of gfxContext with DrawTarget; that's
13% of them.

The patch is mostly plumbing changes. A couple of not-entirely-plumbing
changes:

- It adds a comment about the null check in
  gfxGlyphExtents::GetTightGlyphExtentsAppUnits().

- A couple of functions simply had an unused gfxContext or nsRenderingContext
  parameter removed, e.g. SetLineBreaks().
2015-12-15 13:56:41 -08:00
Simon Montagu
2e70cc5b81 Bug 1162813: filter paragraph separators before passing text to SetPara, r=jfkthame 2015-12-07 21:18:35 +02:00
Jonathan Kew
d8e21a0fd6 Bug 1157727 - Part 0: Preliminary cleanup, remove a bunch of #ifdef'd dead code from nsBidi.cpp. r=smontagu 2015-11-25 12:01:03 +00:00
Ting-Yu Lin
ec7b5746f9 Bug 1226875 - Remove nsIFrame::GetFirstChild(). r=mats 2015-11-26 17:12:39 +08:00
Carsten "Tomcat" Book
6239f3dda0 Backed out changeset 00c2df3df22f (bug 1157727) 2015-11-25 15:37:04 +01:00
Jonathan Kew
bb65e1492f Bug 1157727 - Part 0: Preliminary cleanup, remove a bunch of #ifdef'd dead code from nsBidi.cpp. r=smontagu 2015-11-25 12:01:03 +00:00
L. David Baron
9736962010 Bug 1217833 - Fix container width in exception for line frames in nsBidiPresUtils::ReorderFrames. r=jfkthame 2015-11-24 07:23:14 -08:00
Simon Montagu
432859415f Bug 1216096: restore previous RTL caret behaviour by backout of bug 1164963, bug 1177505, and bug 1180417. r=jfkthame 2015-11-10 04:42:23 -08:00
Mats Palmgren
b853819065 Bug 1210877 - Make nsBidiPresUtils::RepositionFrame work also for box-decoration-break:clone. r=roc 2015-10-03 06:28:00 +02:00
Ted Clancy
6147454967 Bug 1177505 - Make all continuations fluid within non-bidi paragraphs. r=smontagu 2015-07-30 13:47:08 -07:00
Jonathan Kew
e10dc7c646 Bug 1131451 part 2 - Respect the container height when converting vertical-RTL inline-direction coordinates. r=dholbert
* * *
Bug 1131451 part 2a - Remove hack for rtl-in-vertical-mode from ReflowAbsoluteFrame. r=dholbert
* * *
Bug 1131451 part 2b - Mark relative-overconstrained tests that now pass in vertical mode with rtl. r=dholbert
* * *
Bug 1131451 part 2c - Mark vertical border-collapse bevel tests that now pass. r=dholbert
* * *
Bug 1131451 part 2d - Remove partial rtl-in-vertical support from nsBidiPresUtils now that logical-coordinate classes handle it better. r=dholbert
* * *
Bug 1131451 part 2e - Remove hack for float positioning in vertical mode with dir=rtl. r=dholbert
* * *
Bug 1131451 part 2f - Mark vertical-mode float-in-rtl reftests that are now passing. r=dholbert
* * *
Bug 1131451 part 2g - Compute both dimensions of containerSize in nsFlexContainerFrame::DoLayout. r=dholbert
* * *
Bug 1131451 part 2h - Mark flexbox writing-mode tests that are now passing. r=dholbert
2015-07-16 10:08:05 +01:00
Jonathan Kew
7e8bda5a72 Bug 1131451 part 1 - Replace containerWidth with containerSize in logical-coordinate classes and APIs, frame classes, etc. r=dholbert 2015-07-16 10:07:57 +01:00
Xidorn Quan
d2e4a6f285 Bug 1181890 - Center children of ruby content frame if necessary after the bidi reposition. r=jfkthame 2015-07-13 09:32:15 +10:00
Ted Clancy
eedb80a173 Bug 1164693 - Part 2: Frames in a non-bidi paragraph with newline shouldn't be marked as bidi. r=smontagu 2015-06-05 21:46:49 -04:00