Commit Graph

355 Commits

Author SHA1 Message Date
Jonathan Kew
9d8d543eac Bug 1354478 - Adjust caret rect to paint on the opposite side of the nominal caret position in "upstream" text, for more visually consistent placement. r=dholbert 2017-04-12 11:32:19 +01:00
Kartikaya Gupta
4979fd659f Merge m-c to graphics
MozReview-Commit-ID: IN2hMCjMHLL
2017-02-17 23:33:24 -05:00
Mason Chang
e98ed22835 Bug 1337130 - Create a DisplayItemLayer type. r=mattwoodrow 2017-02-14 13:49:27 -08:00
Bill McCloskey
54da76be6b Bug 1339289 - Give names to a lot of common timers (r=ehsan)
MozReview-Commit-ID: IMsv5bkyjBL
2017-02-15 12:30:01 -08:00
Adam Velebil
8425f11c26 Bug 1313565 - Convert NS_STYLE_USER_MODIFY_* to enum class ; r=manishearth,xidorn
MozReview-Commit-ID: IA4bGLgRxd6
2016-10-23 22:41:49 +02:00
Adam Velebil
2c22de0ff7 Bug 1312173 - Convert NS_STYLE_USER_INPUT_* to an enum class; r=manishearth,xidorn
MozReview-Commit-ID: sYiJrZryrA
2016-10-23 00:08:18 +02: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
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
Masayuki Nakano
df276e50d4 Bug 1185307 part.2 Replace upcast from nsISelection to mozilla::dom::Selection with nsISelection::AsSelection() r=smaug
MozReview-Commit-ID: Gs3oiAgJFG9
2016-06-17 22:32:49 +09:00
Xidorn Quan
ba620a636b Bug 1257121 part 4 - Use return value rather than out param to return font metrics. r=jfkthame
MozReview-Commit-ID: 6xrHYbgHGVd
2016-03-17 13:55:48 +08:00
Xidorn Quan
289ca1f35e Bug 1257121 part 3 - Add GetInflatedFontMetricsForFrame function to simplify a common use pattern. r=jfkthame
MozReview-Commit-ID: 4KMLCz6wQHQ
2016-03-17 12:07:47 +08: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
Nicholas Nethercote
bb5a4f7dc2 Bug 1232852 (part 4) - Remove some unused parameters in and around layout/base/. r=heycam. 2016-01-05 16:08:17 -08:00
Mark Capella
33a6284906 Bug 1215959 - (GeckoCaret2) Remove experimental bits added to Touch/Selection carets, r=tylin 2015-12-01 15:25:06 -05: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
Nathan Froyd
4e6d8f6705 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
Jonathan Kew
e252e8c89f Bug 1193519 pt 6 - Adjust the position of the caret bidi indicator appropriately for sideways-lr mode. r=dholbert 2015-09-24 10:23:34 +01:00
Ting-Yu Lin
a56b2e5e55 Bug 1200194 - Expose nsCaret::GetFrameAndOffset for reuse. r=roc
This function can be reused by AccessibleCaret.
2015-09-09 16:47:20 +08:00
Masayuki Nakano
f59053cabd Bug 555642 part.1 nsCaret should have a way to override the caret visible state for hiding caret temporarily and nsEditor should hide caret if composition string doesn't have caret information r=roc 2015-08-17 20:58:38 +09:00
Ted Clancy
983dbf2ce8 Bug 1164693 - Part 1: Directional caret should point in caret direction in bidi paragraphs. r=smontagu 2015-06-05 21:44:54 -04:00
Ted Clancy
a6d1596837 Bug 1067788 - Part 2: Fixes to caret positioning in bidi text. r=smontagu 2015-05-28 08:05:25 -04:00
Mark Capella
b246467b7b Bug 988143 - Enable Gecko Touch in Fennec, Android specific nsCaret mods, r=ehsan 2015-05-14 22:06:13 -04:00
Mark Finkle
e6b5f15406 Bug 1159263 - Add support to nsCaret to stop blinking after a set of cycles r=roc r=snorp 2015-04-29 10:23:19 -04:00
Ethan Lin
c2c987ad14 Bug 1141926 - Check nsCaret visibility when NotifySelectionChanged. r=roc 2015-03-10 23:01:00 -04:00
Ehsan Akhgari
a916924d05 Bug 989012 - Part 1: Stop after passing over a non-selectable frame if one is found during the frame traversal; r=roc
The caret movement code already handles unselectable text frames if we
happen to land in the middle of one in nsTextFrame::PeekOffsetCharacter/Word.
However, when performing frame traversal to find the next frame to jump
to, we don't remember if we skipped over an unselectable frame, which causes
us to jump one offset too much when the caret is on the boundary of
selectable and unselectable content.  The test cases demonstrate the
scenario.  Note that an <img alt=foo> is implemented by adding a
generated content to the inline frame representing it, so as far as
the caret movement code is concerned, both test cases are treated similarly.

Note that we need to do this only when moving the selection, and not
when extending it.  We are adding an aExtend argument to
nsPeekOffsetStruct's constructor in order to be able to special case
that.
2015-01-27 23:11:26 -05:00
Ehsan Akhgari
d4c6d2cd2e Backed out 2 changesets (bug 989012) because of test failure on Linux32 opt mochitest-a11y on a CLOSED TREE
Backed out changeset 9698f6f3f72e (bug 989012)
Backed out changeset 22fb05349a10 (bug 989012)
2015-01-27 16:40:30 -05:00
Ehsan Akhgari
59c2df2758 Bug 989012 - Part 1: Stop after passing over a non-selectable frame if one is found during the frame traversal; r=roc
The caret movement code already handles unselectable text frames if we
happen to land in the middle of one in nsTextFrame::PeekOffsetCharacter/Word.
However, when performing frame traversal to find the next frame to jump
to, we don't remember if we skipped over an unselectable frame, which causes
us to jump one offset too much when the caret is on the boundary of
selectable and unselectable content.  The test cases demonstrate the
scenario.  Note that an <img alt=foo> is implemented by adding a
generated content to the inline frame representing it, so as far as
the caret movement code is concerned, both test cases are treated similarly.

Note that we need to do this only when moving the selection, and not
when extending it.  We are adding an aExtend argument to
nsPeekOffsetStruct's constructor in order to be able to special case
that.
2015-01-27 15:35:32 -05:00
Jonathan Kew
6a5c361e8b Bug 1077515 - part 3 - Change desiredX (nscoord) to desiredPos (nsPoint) in nsPeekOffsetStruct, to support maintaining either vertical or horizontal position on inter-line moves. r=roc 2014-11-22 14:39:03 +00:00
Simon Montagu
4c365d8f67 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
Simon Montagu
3eb81bde1c Bug 1100071 patch 1: change uint8_t to nsBidiLevel in a few more places, r=dholbert 2014-11-20 12:45:22 +02:00
Daniel Holbert
204aad175f Bug 1098558: Remove unused constant NS_STYLE_DIRECTION_INHERIT. r=smontagu 2014-11-13 15:50:39 -08:00
Jonathan Kew
c8db4d94cb Bug 1093553 - Followup to fix positioning of the caret with writing-mode:vertical-lr and text-orientation:sideways-right. r=smontagu 2014-11-13 08:58:06 +00:00
Jonathan Watt
474e2fff50 Bug 1090611 - Make nsCaret::PaintCaret take a Moz2D DrawTarget instead of nsRenderingContext. r=Bas 2014-10-29 17:07:11 +00:00
Jonathan Watt
05b59bc989 Bug 1088625, part 1 - Add lots of missing nsFontMetrics.h and gfxTextRun.h includes 2014-10-24 16:28:14 +01:00
Jonathan Watt
3b52cf43ad Bug 1086708 - Rename the snapping variant of NSRectToRect to NSRectToSnappedRect. r=mattwoodrow 2014-10-22 12:29:06 +01:00
Jonathan Watt
40da0a5dbd Bug 1083753, part 2 - Port the code that uses nsRenderingContext::FillRect(nsRect) to Moz2D. r=mattwoodrow 2014-10-19 13:22:22 +01:00
Jonathan Kew
dbd542017f Bug 902762 pt 7 - Draw caret appropriately for vertical textruns. r=smontagu 2014-10-01 20:25:50 +01:00
Mason Chang
4ec05c47e8 Bug 1063265 - Stop Blinking the Text Caret when it isn't visible. r=roc 2014-09-06 12:25:00 +02:00
Robert O'Callahan
53bc0bc443 Bug 1048752. Part 39: Call SelectionLanguageChange even when bidi keyboard is not available, for consistency, and fix broken tests. r=jfkthame 2014-08-13 01:27:02 +12:00
Robert O'Callahan
a127e060c2 Bug 1048752. Part 37: GetGeometryForFrame should return a rect instead of an nsresult. r=tn 2014-08-06 17:19:32 +12:00
Robert O'Callahan
61e0866c4d Bug 1048752. Part 36: Remove ancient horizontal rules. r=tn 2014-08-06 17:19:31 +12:00
Robert O'Callahan
5902534db2 Bug 1048752. Part 35: Remove GetFrameSelection (unused). r=tn 2014-08-06 17:19:31 +12:00
Robert O'Callahan
d9b69b3d08 Bug 1048752. Part 34: Handle null selection returned by GetSelection(). r=tn
Previous changes broke this. Tests caught it.
2014-08-06 17:19:31 +12:00
Robert O'Callahan
0e15cd5d98 Bug 1048752. Part 33: A zero blink rate should mean the caret is always on. r=tn
Previous changes broke this.
2014-08-06 17:19:31 +12:00
Robert O'Callahan
3d7390b063 Bug 1048752. Part 32: Rename DrawAtPosition to SetCaretPosition and don't make it turn off blinking. r=tn
There's no need for this method to turn off blinking anymore. Its only
caller already calls SetCaretReadOnly to achieve the same effect. That
means we don't actually need the mIsBlinking flag after all.
2014-08-06 17:19:31 +12:00
Robert O'Callahan
a3dfe0f5b1 Bug 1048752. Part 31: nsCaret.h must be the first #include in nsCaret.cpp. r=tn
Also cleans up a couple of other ordering issues.
2014-08-06 17:19:30 +12:00
Robert O'Callahan
e06fa28324 Bug 1048752. Part 30: Simplify caret blinking logic. r=tn
A few things got mashed together here:
-- Inline KillTimer/PrimeTimer into their callers.
-- Instead of having to call StopBlinking and StartBlinking together,
change StartBlinking to ResetBlinking and have it set up
the correct blink state and reset the blink cycle.
-- nsCaret::NotifySelectionChange needs a SchedulePaint
-- nsCaret::DrawAtPosition needs a ResetBlinking
2014-08-06 17:19:30 +12:00
Robert O'Callahan
769a938550 Bug 1048752. Part 29: mVisible is never true in nsCaret::Init. r=tn 2014-08-06 17:19:30 +12:00
Robert O'Callahan
3a827f62c8 Bug 1048752. Part 28: Remove unused fields and rename mLast* to mOverride*. r=tn 2014-08-06 17:19:30 +12:00