Commit Graph

7131 Commits

Author SHA1 Message Date
Seth Fowler
d7be6c6847 Bug 35168 (Part 2) - Allow relative positioning of internal table objects. r=dbaron 2014-08-19 18:24:58 -07:00
Ryan VanderMeulen
476e0aef44 Merge m-c to inbound. a=merge 2014-08-19 16:25:33 -04:00
Botond Ballo
1d16def11d Bug 923512 - Introduce strongly-typed coordinate classes. r=kats,Bas
--HG--
extra : rebase_source : 22e5fe577ea503aede765c70e16c0bf875c4a9fd
2014-08-19 13:08:16 -04:00
Botond Ballo
aef24da2ed Bug 923512 - Transition the TransformTo<>() functions from gfx3DMatrix to Matrix4x4. r=kats
--HG--
extra : rebase_source : 3a82faa2e95b889cb19db5cc24e24d74e6498f08
2014-08-06 12:52:04 -04:00
Robert O'Callahan
d61cef56ec Bug 1048752. Part 39: Call SelectionLanguageChange even when bidi keyboard is not available, for consistency, and fix broken tests. r=jfkthame
--HG--
extra : rebase_source : c25d92fbc1d2237c35de80f0273dc00e81d0444d
2014-08-13 01:27:02 +12:00
Robert O'Callahan
4e7ef71b18 Bug 1048752. Part 37: GetGeometryForFrame should return a rect instead of an nsresult. r=tn
--HG--
extra : rebase_source : f49846cc50de2a3a616a991d81b38bf6c1d9a2c5
2014-08-06 17:19:32 +12:00
Robert O'Callahan
b9eb4b74d7 Bug 1048752. Part 36: Remove ancient horizontal rules. r=tn
--HG--
extra : rebase_source : 7537ad3060b7703565d2a259109fae96e238e0a4
2014-08-06 17:19:31 +12:00
Robert O'Callahan
9e3f9ec33b Bug 1048752. Part 35: Remove GetFrameSelection (unused). r=tn
--HG--
extra : rebase_source : 4b528b7de79bf3f1e03891cb093d16a111605c2c
2014-08-06 17:19:31 +12:00
Robert O'Callahan
3874da6a87 Bug 1048752. Part 34: Handle null selection returned by GetSelection(). r=tn
Previous changes broke this. Tests caught it.

--HG--
extra : rebase_source : 20f365b3f6074fe18d4aaa7f81baf64f3b64e8de
2014-08-06 17:19:31 +12:00
Robert O'Callahan
9bd73f017e Bug 1048752. Part 33: A zero blink rate should mean the caret is always on. r=tn
Previous changes broke this.

--HG--
extra : rebase_source : d0dc9bd22f93f40465b3448cf20050ac725ee560
2014-08-06 17:19:31 +12:00
Robert O'Callahan
87f76c825e 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.

--HG--
extra : rebase_source : 9d4c31282ed280c0f822f1d9f7fa8ae1c2ba6cab
2014-08-06 17:19:31 +12:00
Robert O'Callahan
d23ebbff90 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.

--HG--
extra : rebase_source : 3c5e3f4b56cf3d11b73e9d495fc6c2c8a8170e5f
2014-08-06 17:19:30 +12:00
Robert O'Callahan
31539d61d7 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

--HG--
extra : rebase_source : abc7fd78c4f20b787b212e1e3f13226a1ccff16b
2014-08-06 17:19:30 +12:00
Robert O'Callahan
de0cd02d0a Bug 1048752. Part 29: mVisible is never true in nsCaret::Init. r=tn
--HG--
extra : rebase_source : 7fd2386e3f5ea667bc0ff4948182187d56647482
2014-08-06 17:19:30 +12:00
Robert O'Callahan
a8c6bcad57 Bug 1048752. Part 28: Remove unused fields and rename mLast* to mOverride*. r=tn
--HG--
extra : rebase_source : 71f40b16935dc57b2ea8674ebb28d93cfe85567d
2014-08-06 17:19:30 +12:00
Robert O'Callahan
343a7df89e Bug 1048752. Part 27: Remove obsolete caret state logic and just SchedulePaint as needed. r=tn
This is the core of the whole patch set.

Now GetPaintGeometry/PaintCaret figure out on their own almost all the state
they need every time we paint. So when caret flags change, all we need
to do is SchedulePaint. We don't need to fiddle with mDrawn and most of the
logic in DrawCaret is obsolete. (In fact, it was duplicated by GetGeometry
and friends, and we're removing that duplication.) EraseCaret, CheckCaretState
and UpdateCaretPosition are also obsolete.

We need to have GetPaintGeometry/PaintCaret choose the correct content node
and offset, either getting them from the Selection or using specific data set by
DrawAtPosition. This logic, plus a bit of other code shared between them, is
put into the helper GetFrameAndOffset.

--HG--
extra : rebase_source : e777605dd2507ae043e9f82d0a30e23aa06e0c12
2014-08-06 17:19:29 +12:00
Robert O'Callahan
40c7848353 Bug 1048752. Part 26: Move all "should draw caret" responsibility to GetPaintGeometry. r=tn
Instead of checking the mysterious mDrawn state (which is evil and will be
removed), let nsCaret::GetPaintGeometry take sole responsibilty for deciding
whether to draw. It takes the nsStyleUserInterface checks. It also needs to
check blink state, which is made possible by separating blink state into
the mIsBlinkOn flag.

--HG--
extra : rebase_source : 4a4796c37bc9ec7c25ffb2a320f9484cee1dc52f
2014-08-06 17:19:29 +12:00
Robert O'Callahan
d3a40df85c Bug 1048752. Part 25: Inline MustDrawCaret into IsVisible. r=tn
This also fixes what appears to be a bug. MustDrawCaret returned true
when mShowDuringSelection is set even if the caret would otherwise be
hidden due a popup showing. That doesn't make sense.

--HG--
extra : rebase_source : e05e0892a85448dbc6666e23a0dbc7fa21a9c61e
2014-08-06 17:19:29 +12:00
Robert O'Callahan
70c695fa57 Bug 1048752. Part 24: Rename and deCOM Set/GetCaretVisible. r=tn
--HG--
extra : rebase_source : 04249e9b22a62b8f2952515fa48f4ba3227e235e
2014-08-06 17:19:29 +12:00
Robert O'Callahan
acbc163fc1 Bug 1048752. Part 23: Remove aIgnoreDrawnState from MustDrawCaret. r=tn
--HG--
extra : rebase_source : 20e724ce09deec3987437838ac9f05e84ddbe2fd
2014-08-06 17:19:28 +12:00
Robert O'Callahan
b1e6bddb83 Bug 1048752. Part 22: Factor out SelectionLanguageChange call to run early in nsCaret::GetPaintGeometry. r=tn
This code is somewhat tricky. nsCaret::ComputeCaretRects was checking to see
if we have a bidi keyboard, and if so, what direction it's set to.
If the direction changed from the last direction seen for *this caret*,
we fired a SelectionLanguageChange notification on the caret's current
Selection. This looked bogus because the caret can be switched between
selections so it would seem some selections won't get a notification when
they should, but that's how it was. Also, when the SelectionLanguageChange
notification fired we then didn't draw the caret in that iteration, which
seems even more bogus.

This patch fixes all that by moving the logic to fire SelectionLanguageChange
out to GetPaintGeometry and firing the notification every single time without
trying to detect whether the state has changed or not. I carefully examined
the implementation of SelectionLanguageChange and I'm pretty sure it's
idempotent so this should be correct. That doesn't look like an
expensive function, and runs at most once per window paint, so I'm not
worried about perf. Because we now fire SelectionLanguageChange before
reading selection or frame state, it should be fine to carry on after
calling SelectionLanguageChange and drawing the caret based on whatever
changes SelectionLanguageChange has performed.

This also lets us remove mKeyboardRTL, which as noted above seems inherently
bogus.

--HG--
extra : rebase_source : 3ddfd10f6f30033e090e72b4bb43f2695218752e
2014-08-06 17:19:28 +12:00
Robert O'Callahan
ad25f90af2 Bug 1048752. Part 21: Instead of storing mCaretRect/mHookRect, recompute them whenever they're needed. r=tn
Also, moves the "If the offset falls outside of the frame" check from
PaintCaret to GetPaintGeometry so we do less work in that case.

UpdateCaretRects is no longer needed.

--HG--
extra : rebase_source : 4b2925952a34d0388ae44c642129ce9015c367ea
2014-08-06 17:19:28 +12:00
Robert O'Callahan
a3ebb7d120 Bug 1048752. Part 20: Inline GetCaretFrame into its callers. r=tn
This duplicates some code, but later patches will modify the callers and then
eventually we'll re-share common code.

--HG--
extra : rebase_source : 53f4756e87aadf22046972ef9102c190fbb35132
2014-08-06 17:19:28 +12:00
Robert O'Callahan
27a3fe0069 Bug 1048752. Part 19: Create nsCaret::GetPaintGeometry to call during painting. r=tn
This is the start of the changes to caret-drawing proper.

The idea is to combine GetCaretFrame and GetCaretRect into a method
GetPaintGeometry which looks like GetGeometry but returns values
needed for painting (i.e. including bidi decorations, and returning
a null frame if we're not supposed to paint due to specific caret
state, e.g. in the "off" phase of the blink cycle).

Mostly a straightforward refactoring but there are a few interesting changes:
-- nsDisplayCaret stores its bounds instead of getting them from nsCaret on
demand. Eventually those bounds will not be stored in nsCaret at all.
-- nsDisplayCaret::GetBounds returns true for aSnap. nsCaret draws snapped
rects, so why not.
-- I removed "if (caretRect.Intersects(aDirtyRect))" in EnterPresShell.
As far as I can tell, this check is incorrect because it doesn't take
transforms into account. Since there's at most one drawn caret per window,
hence we do this at most once per paint, I don't think there's any real
performance advantage to having this check.

--HG--
extra : rebase_source : c98d3a5994478b482d19cc2e2ac83ab51bd17e00
2014-08-06 17:19:28 +12:00
Robert O'Callahan
1b1473f94c Bug 1048752. Part 18: Add nsCaret::SchedulePaint. r=tn
We'll use this later.

--HG--
extra : rebase_source : e2d81ec006718d1c91b47978c16df0bffd42ff5b
2014-08-06 17:19:27 +12:00
Robert O'Callahan
9780343dd6 Bug 1048752. Part 17: Rename Get/SetCaretDOMSelection to Get/SetSelection. r=tn
The forward declaration of Selection in nsCaret.h will be used in later patches.

--HG--
extra : rebase_source : d1b749adac983c04d3365bb6bfb76a50101beeb5
2014-08-06 17:19:27 +12:00
Robert O'Callahan
ae6a16193a Bug 1048752. Part 16: Move nsFrameSelection::HINT to CaretAssociationHint.h. r=tn
This patch started an attempt to remove nsFrameSelection.h from nsCaret.h
and metastasized into a rather large refactoring patch that removed it
from some other header files as well, and changed nsFrameSelection::HINT
into a global-scope enum with better names. I also converted bools
into CaretAssociationHint in a few places where that was appropriate,
but there are still some more places (GetChildFrameContainingOffset)
where bools need to be converted. I figured this patch was big enough already.

--HG--
extra : rebase_source : cc618ef60e707e1360644340a2648de389383da0
2014-08-06 17:19:27 +12:00
Robert O'Callahan
b796347bb8 Bug 1048752. Part 15: Fix some comments. r=tn
--HG--
extra : rebase_source : c21e494622615b306e796afedf6c0a424d6f1046
2014-08-06 17:19:26 +12:00
Robert O'Callahan
922821fdc8 Bug 1048752. Part 14: Split GetGeometry into a static and a non-static version. r=tn
GetGeometry is used in two different ways. Sometimes it's used to get
information about a particular caret. Sometimes it's used to get
information about a particular selection that's not associated with
a caret. Splitting GetGeometry into a non-static version for the former
and a static version for the latter makes this more clear. Also it saves
code since for the latter version we don't have to get an nsCaret first.

--HG--
extra : rebase_source : b7730dac56b308a82b79b175749234c9a92b6f59
2014-08-06 17:19:26 +12:00
Robert O'Callahan
534e15cb7d Bug 1048752. Part 13: Remove GetGeometry's aBidiIndicatorSize. r=tn
Callers always pass null.

--HG--
extra : rebase_source : 169f9fe4f4236cffe2c0f760305ebf8093300c69
2014-08-06 17:19:26 +12:00
Robert O'Callahan
857db778d8 Bug 1048752. Part 12: Replace mBlinkRate with mIsBlinking. r=tn
We don't need to store the blink rate. Instead we can just fetch it whenever
we need it. However we do need a flag to handle the case where
nsCaret::DrawAtPosition disables blinking.

--HG--
extra : rebase_source : 4f36825a8e22edd3a2e37edb1fae5675c85adadd
2014-08-06 17:19:26 +12:00
Robert O'Callahan
52ce18f581 Bug 1048752. Part 11: Remove nsLayoutUtils.h from nsDisplayList.h. r=tn
--HG--
extra : rebase_source : 02251076442a5c4251e8d9484cb428a4c07f3a13
2014-08-06 17:19:25 +12:00
Robert O'Callahan
912c1e35de Bug 1048752. Part 10: Remove FrameLayerBuilder.h from nsDisplayList.h. r=tn
I was inspired by the previous patch to remove FrameLayerBuilder.h from
nsDisplayList.h too.

--HG--
extra : rebase_source : b34a01bea5865da4737817e2396b98d54cc6d1bf
2014-08-06 17:19:25 +12:00
Robert O'Callahan
7ea822125b Bug 1048752. Part 9: Remove nsCaret.h from nsDisplayList.h. r=tn
I got tired of slow build turnarounds every time I modified nsCaret.h.

--HG--
extra : rebase_source : 0c4598c4881ab8de0a636b08c70fb801bb912247
2014-08-06 17:19:25 +12:00
Robert O'Callahan
22a250e9db Bug 1048752. Part 8: Remove mCaretAspectRatio. r=tn
mCaretAspectRatio doesn't need to be stored. We can recompute it
whenever we need it.

--HG--
extra : rebase_source : 065a6996e920800edf5cbcc7f072f0439ef84553
2014-08-06 17:19:25 +12:00
Robert O'Callahan
9501a2c9ee Bug 1048752. Part 7: Remove mCaretWidthCSSPx. r=tn
mCaretWidthCSSPx doesn't need to be stored. We can just recompute it
whenever we need it.

--HG--
extra : rebase_source : 850b556651afade0da543e281e5fa54235969ab4
2014-08-06 17:19:25 +12:00
Robert O'Callahan
8932f6dda1 Bug 1048752. Part 6: Remove 'virtual' declarations. r=tn
These used to be needed for linking with non-libxul builds, but are no
longer needed. The obsolete comment is fixed in a later patch.

--HG--
extra : rebase_source : 034f69b647bd64d4353e51a15e166094b7b2e638
2014-08-06 17:19:24 +12:00
Robert O'Callahan
069d4c4180 Bug 1048752. Part 5: Reorder API declarations. r=tn
To make it more clear what's going on, make CaretBlinkCallback protected
and reorder the public methods to put the state-changing "API" methods first.

--HG--
extra : rebase_source : fddf0ea4b9269b2d431d0b75c40f99a9140138a1
2014-08-06 17:19:24 +12:00
Robert O'Callahan
8c19042ffb Bug 1048752. Part 4: Make EViewCoordinates (unused). r=tn
--HG--
extra : rebase_source : 571ba155fb5741fdd26d0391ef4a029a7383b34a
2014-08-06 17:19:24 +12:00
Robert O'Callahan
311f843a5a Bug 1048752. Part 3: Make GetCaretFrameForNodeOffset static. r=tn
GetCaretFrameForNodeOffset only uses the nsFrameSelection and mBidiUI
from its nsCaret. For mBidiUI we can just get the pref directly whenever
we need it. By modifying GetCaretFrameForNodeOffset to take nsFrameSelection
as a parameter, we can make it static to make it clear it isn't really
related to the state of the nsCaret.

This may also fix a bug in Selection::GetPrimaryFrameForFocusNode where
things would go unexpectedly wrong if mCaret is temporarily observing
a different selection to the Selection.

--HG--
extra : rebase_source : cdd59f6e20cd1060bc5d2325cb3adb5e5c4a1d2c
2014-08-06 17:19:24 +12:00
Robert O'Callahan
2aa74c872a Bug 1048752. Part 2: Remove InvalidateOutsideCaret and MaybeInvalidateCaretPosition. r=tn
I'm quite sure DLBI means we don't need these anymore.

--HG--
extra : rebase_source : 6cb6cd7c160a46688793c6ab1cdded333aecdd61
2014-08-06 17:19:23 +12:00
Robert O'Callahan
8a36ee38de Bug 1048752. Part 1: Remove GetCaretReadOnly (unused). r=tn
--HG--
extra : rebase_source : 86c27ad506440199fe623a083a2b4cb7eca98e47
2014-08-06 17:19:23 +12:00
Daniel Holbert
36ec299778 Bug 1054563: Remove unnecessary nsresult return value from BuildScrollFrame, and de-indent it. r=tn 2014-08-15 20:22:09 -07:00
Ting-Yu Lin
2c800401af Bug 1016184 - Part 3i: Fix test_reftests_with_caret.html on Mulet. r=ehsan
bug512295-1.html and bug512295-2.html are sending key events which hides
touch caret. Turn off the touch caret preference to fix test cases that
ought to be failed by definition of the touch caret behavior.
2014-08-18 00:02:00 -04:00
Susanna Bowen
845188e8cd Bug 1030993 - Fix assertion failure in reftest css-ruby/ruby-whitespace-1.html. r=dbaron
Fixes the assertion failure with text:
"###!!! ASSERTION: Wrong line container
hint: '!aForFrame || (aLineContainer == FindLineContainer(aForFrame) ||
aLineContainer->GetType() == nsGkAtoms::rubyTextContainerFrame ||
(aLineContainer->GetType() == nsGkAtoms::letterFrame &&
aLineContainer->IsFloating()))', file
/home/sgbowen/builds/mozilla-central/layout/generic/nsTextFrame.cpp, line 1259"
which occasionally appears when opening pages with ruby or when running ruby
reftests.

Updates the manifest for ruby reftests to the current expectations (adjust
assertion counts, etc.)
2014-08-15 10:34:20 -07:00
Susanna Bowen
d4c7a65b4c Bug 1030993 - Basic reflow implementation for ruby frame classes. r=dbaron
To account for spacing between bases or text boxes during reflow, the line
layout which manages the bases updates its inline direction coordinate based on
the preferred inline size for the corresponding text boxes. Next, the base is
reflowed at the correct inline coordinate. Each paired text box is then also
reflowed at the proper inline position determined by (1) the current position of
its corresponding base and (2) its own preferred width.

In computing intrinsic widths, accounting for spacing is less complicated. The
minimum intrinsic width is the width of the widest ruby column, and the
preferred intrinsic width is the sum of all the ruby column widths. Each ruby
column width is the maximum width of its base box and text boxes. These
individual widths are determined using GetPrefISize on the base and text boxes.

Ruby base container frames store a list of pointers to the ruby text container
frames in the segment they denote. This list of pointers is created in the ruby
frame reflow method before calling the reflow method for the ruby base
container. The list exists and is used only during reflow of the main ruby frame
and is cleared before returning from reflow.
2014-08-15 10:34:20 -07:00
Matt Woodrow
7316002fec Bug 1053078 - Use a timeout instead of tick count for preventing refresh driver hangs since ASAP mode accumulates tick counts too quickly. r=roc
--HG--
extra : rebase_source : b19754d2b3e6731fb89d89ac093f144c8d786b07
2014-08-15 14:24:50 +12:00
Seth Fowler
1694419abc Bug 913586 (Part 7) - Update Maybe users in layout. r=dbaron
--HG--
extra : rebase_source : 1bf45d1356d36269ca951b58ebf1e448313c55c5
2014-08-13 15:42:15 -07:00
L. David Baron
1b0226483c Bug 625289 patch 11 - Call RestyleManager::TryStartingTransition during frame construction. r=heycam 2014-08-13 15:39:02 -07:00
L. David Baron
8a3adaaf25 Bug 625289 patch 9 - Convert nsCSSFrameConstructor::ResolveStyleContext away from early returns. r=heycam 2014-08-13 15:39:02 -07:00