Commit Graph

97 Commits

Author SHA1 Message Date
Xidorn Quan
8e36f5d113 Bug 1160847 part 4 - Remove useless lineOffset variable in nsBidiPresUtils::ResolveParagraph. r=jfkthame
MozReview-Commit-ID: 7YRIg9TmExp

--HG--
extra : source : 962291a39b4172f341f8e09ae001d5f5ce732740
2016-06-29 17:48:00 +10:00
Xidorn Quan
c353935ab6 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

--HG--
extra : source : 5d0cf1cbd270e9963d848a23b37528ed503ed6a0
2016-06-29 17:47:18 +10:00
Xidorn Quan
90c5357c7f 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

--HG--
extra : source : 28fa56b841de689691375e8e2d5e56014921b48e
2016-06-29 17:47:00 +10:00
Nicholas Nethercote
3ba02d7a9b Bug 1232852 (part 3) - Remove unused parameters from some accessibility code. r=tbsaunde.
--HG--
extra : rebase_source : 7cdef8244e2b44b89e8061f66d45d40cbf245041
2015-12-15 21:24:06 -08:00
Nicholas Nethercote
06e901cb9f 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().

--HG--
extra : rebase_source : 8f56994bb4d254a86788b17ab2864ebc758a7e6b
2015-12-15 13:56:41 -08:00
Birunthan Mohanathas
a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Xidorn Quan
33c1455032 Bug 1181890 - Center children of ruby content frame if necessary after the bidi reposition. r=jfkthame
--HG--
extra : source : db370ccfe5334eae5c4397a8ababab12f0794099
2015-07-13 09:32:15 +10:00
Matt Brubeck
f222d23c4e Bug 1169088 - Remove unused nsBidiPresUtils methods. r=dbaron
These were used only in nsSVGGlyphFrame which was removed in bug 889736.
2015-05-27 19:06:33 -07:00
Xidorn Quan
25da0b552a Bug 1141931 patch 10 - Revert to pass container size instead of only isize for bidi reordering. r=smontagu
--HG--
extra : source : 85a623e012b8deb2a41dc2e633a41223727bfe50
2015-04-08 11:22:34 +12:00
Xidorn Quan
98f15072a3 Bug 1141931 part 8 - Reorder ruby frames regarding their direction. r=jfkthame
--HG--
extra : source : 2ab8fdf15b09df128e03998c2daf26c48187851d
2015-04-08 11:22:34 +12:00
Xidorn Quan
7ed44c4442 Bug 1141931 part 4 - Make bidi reordering always in frame order. r=jfkthame,smontagu
--HG--
extra : source : dc2ce78ff7bc9e2b5ccb7308609a83feca6a1c22
2015-04-08 11:22:34 +12:00
Xidorn Quan
e581fcaf13 Bug 1141931 part 3 - Adjust some parameters of functions in nsBidiPresUtils. r=jfkthame
Includes two changes:
* aContainerSize of ReorderFrames, RepositionInlineFrames, RepositionFrame are changed to aContainerISize;
* the type of aContainuationStates in the functions above is changed to const pointer.

--HG--
extra : source : 41336b712d88a843b15015321cae9f878aa08427
2015-04-08 11:22:34 +12:00
Wes Kocher
74f58c915e Backed out 10 changesets (bug 1141931) for mochitest-5 failures CLOSED TREE
Backed out changeset c90940067de6 (bug 1141931)
Backed out changeset 96b48288abab (bug 1141931)
Backed out changeset 87281c7ded34 (bug 1141931)
Backed out changeset 6a914ba0b8ec (bug 1141931)
Backed out changeset 9cfea55b5e95 (bug 1141931)
Backed out changeset f432612b6475 (bug 1141931)
Backed out changeset 48cf9568a4b1 (bug 1141931)
Backed out changeset f1ab848b3fa6 (bug 1141931)
Backed out changeset 8a3c71a3b525 (bug 1141931)
Backed out changeset 119d3c0fd0f6 (bug 1141931)
2015-04-07 14:23:57 -07:00
Xidorn Quan
ff332f3d74 Bug 1141931 patch 10 - Revert to pass container size instead of only isize for bidi reordering. r=smontagu
--HG--
extra : source : 999cbb6740648762984e57d5ce764499381ccd5b
2015-04-08 08:40:31 +12:00
Xidorn Quan
8a236c4404 Bug 1141931 part 8 - Reorder ruby frames regarding their direction. r=jfkthame
--HG--
extra : source : 1cd39beced7297440bf4e8df906c5264302ac16d
2015-04-08 08:40:31 +12:00
Xidorn Quan
3e7300ba91 Bug 1141931 part 4 - Make bidi reordering always in frame order. r=jfkthame,smontagu
--HG--
extra : source : dc2ce78ff7bc9e2b5ccb7308609a83feca6a1c22
2015-04-08 08:40:31 +12:00
Xidorn Quan
8a3d0926c5 Bug 1141931 part 3 - Adjust some parameters of functions in nsBidiPresUtils. r=jfkthame
Includes two changes:
* aContainerSize of ReorderFrames, RepositionInlineFrames, RepositionFrame are changed to aContainerISize;
* the type of aContainuationStates in the functions above is changed to const pointer.

--HG--
extra : source : 41336b712d88a843b15015321cae9f878aa08427
2015-04-08 08:40:31 +12:00
Simon Montagu
9cdb41a6f4 Bug 1131013: when setting the position of inline frames in vertical writing modes with right-to-left direction, subtract the inline start from the container height to get the correct vertical position. r=jfkthame 2015-02-11 01:43:03 -08:00
Simon Montagu
2f9f1b57d2 Bug 1100071 patch 3: don't pass around bidi levels when we only need the direction, r=dholbert 2014-11-20 12:45:23 +02:00
Simon Montagu
ad766a1fcb Bug 1100071 patch 2: add macros for common tests whether bidi level is odd and whether two bidi levels have the same parity, r=dholbert 2014-11-20 12:45:22 +02:00
Jonathan Watt
1c3326bede Bug 1088625, part 2 - Pass nsFontMetrics objects through to code that needs it instead of storing it on the nsRenderingContext. r=mstange 2014-10-24 16:28:14 +01:00
Jonathan Kew
4778df83d1 Bug 1080621 - Don't pass nscoord in-params by reference in nsBidiPresUtils methods. r=smontagu 2014-10-16 09:40:20 +01:00
Simon Montagu
5240838225 Bug 1069941 patch 3: Pass the frame physical width, not inline size, to the inner loop of RepositionFrame, plus cosmetic fixes, r=jfkthame 2014-09-30 10:59:14 -07:00
Simon Montagu
72a6973797 Bug 1069941 patch 2: reset the start coordinate of the inline frames before ReorderFrames so that the margin doesn't get added twice, r=jfkthame 2014-09-30 10:59:13 -07:00
Simon Montagu
859e13d16d Bug 1069941 patch 1: be more accurate when identifying the first and last frames on the line and applying margin/border/padding, r=jfkthame 2014-09-30 10:59:13 -07:00
Ehsan Akhgari
60360fc645 Bug 1060985 - Fix more bad implicit constructors in layout; r=roc 2014-08-31 23:36:37 -04:00
Ehsan Akhgari
2ecbad7b1c Bug 491863 - Remove IBMBIDI; r=roc 2014-04-23 21:15:29 -04:00
Simon Montagu
2110ef8dc6 Use logical text layout API in nsLineLayout. Bug 789096, r=jfkthame 2014-03-11 13:23:50 -07:00
Carsten "Tomcat" Book
b99f5df532 Backed out changeset aeff4052ef00 (bug 789096) 2014-03-11 09:22:52 +01:00
Simon Montagu
5e0cf76c45 Use logical text layout API in nsLineLayout. Bug 789096, r=jfkthame 2014-03-10 22:19:03 -07:00
Ehsan Akhgari
1b83407ce9 Bug 927728 - Part 1: Replace PRUnichar with char16_t; r=roc
This patch was automatically generated by the following script:

#!/bin/bash
# Command to convert PRUnichar to char16_t

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*modules/libmar*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name prtypes.h \
       ! -name Char16.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRUnichar char16_t
2014-01-04 10:02:17 -05:00
Simon Montagu
342f8fc7a7 Add support for unicode-bidi: -moz-plaintext in XUL. Bug 869833, r=roc 2013-11-18 17:24:16 +02:00
Ehsan Akhgari
2621b190f1 Bug 906790 - Minimize layout/base #includes; r=roc 2013-08-19 18:55:18 -04:00
Ehsan Akhgari
e368dc9c85 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
David Zbarsky
03039446fa [Bug 780428] Don't include nsIFrame.h in places where it's not necessary r=roc 2012-08-05 23:00:56 -04:00
Aryeh Gregor
d0ad5a7d0c Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Gervase Markham
82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Simon Montagu
5a201aafa0 Add a mParagraphDepth member to BidiParagraphData and cache it on frames to track nested bidi-isolated paragraphs. Use mParagraphDepth (* 2 + isRTL in order to keep LTR even and RTL odd) as the initial paragraph embedding level instead of pushing a stack of embedding codes. Pass the <bdi> frame instead of its first-child to BidiParagraphData::Reset and save a call to GetParent(). Split inline ancestors before and after bidi-isolated paragraphs, in the same way that we currently do between runs in different directions. This required also adding code to SplitInlineAncestors to handle situations where the parent frame is being split before its first child or after its last child. In JoinInlineAncestors, prevent frames that belong to paragraphs isolated from one another from being rejoined. Bug 712600, r=ehsan, roc 2012-01-11 21:26:02 +02:00
Simon Montagu
47421feaee Test the containing frame for continuations, not the child. Bug 698706, r=roc 2011-11-07 16:26:50 +02:00
Simon Montagu
8920dd6e82 Implement unicode-bidi: -moz-isolate in layout. Bug 613149, r=roc 2011-10-18 14:51:57 +02:00
Michael Wu
d2b70213ac Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
--HG--
rename : tools/trace-malloc/bloatblame.c => tools/trace-malloc/bloatblame.cpp
2011-09-28 23:19:26 -07:00
Simon Montagu
c5979d144a Make all nsBidiPresUtils methods static. Bug 624798, r=roc 2011-04-13 12:23:49 +03:00
Simon Montagu
e5fa7e72ec Include continuations of frames with no newline. Bug 582181, r=roc 2011-06-15 10:45:57 +03:00
Simon Montagu
bd31151e86 Bug 263359/Bug 229367: resolve paragraph on encountering <br> or embedded block elements. r=roc 2011-04-11 10:59:30 +03:00
Simon Montagu
03eab42cad Bug 263359 part 2.5: cache lines per frame in TraverseFrames. r=roc 2011-06-09 09:29:08 +03:00
Simon Montagu
8a9c0b3f06 Bug 263359 part 2: split nsBidiPresUtils::Resolve into Resolve and ResolveParagraph. r=roc 2011-04-11 10:59:30 +03:00
Simon Montagu
5deaf7deba Bug 263359 part 1: refactor bidi resolution code, combining InitLogicalArray and CreateBlockBuffer. r=roc 2011-04-11 10:59:30 +03:00
Simon Montagu
f213cf876f Back out bug 263359 and bug 624798 because of performance regressions (bug 650189) 2011-04-27 11:47:18 +03:00
Jan Küchler
c510bc3046 Bug 266236 part 3: Mechanical rename of nsIRenderingContext and nsThebesRenderingContext to nsRenderingContext. Mechanical substitution of nsRefPtr<nsRenderingContext> for nsCOMPtr<nsRenderingContext>.
--HG--
rename : gfx/src/nsThebesRenderingContext.cpp => gfx/src/nsRenderingContext.cpp
extra : rebase_source : 34884bfcafd885feaf73300bc7246cd192062a48
2011-04-07 18:04:40 -07:00
Simon Montagu
c808d636dc Make all nsBidiPresUtils methods static. Bug 624798, r=roc 2011-04-13 12:23:49 +03:00