Commit Graph

20 Commits

Author SHA1 Message Date
Boris Zbarsky
2b6097ae6d Bug 1455055 part 1. Convert nsIDOMEventListener to taking an Event, not an nsIDOMEvent. r=masayuki
This does no cleanup other than what's needed to compile.  Cleanup coming up in
later patches.

MozReview-Commit-ID: 3sOnkj71n09
2018-04-20 00:49:29 -04:00
Ting-Yu Lin
2a80705ce0 Bug 1296990 - Make AppearanceString() return nsAutoString directly. r=mtseng
MozReview-Commit-ID: IQ3KrFnCswx

--HG--
extra : rebase_source : ed646cc89797c104708c55d50a058ddd6c76b5bd
2016-08-21 21:41:32 +08:00
Ting-Yu Lin
1ef637a036 Bug 1292904 Part 3 - Use only caret image for touch area if event is a mouse type. r=mtseng
That is, exclude the text overlay to fix the double clicking and triple
clicking on a word in editable text area.

MozReview-Commit-ID: 5bELcNSRo2A

--HG--
extra : rebase_source : 4664e186b13b3170022c0fe294f580cd15650271
2016-08-14 21:39:30 +08:00
Ting-Yu Lin
b2eef835ec Bug 1292904 Part 2 - Split touch area into image and text overlay. r=mtseng
The touch area of the caret element includes the caret image and the
text above the image. This patch split these two areas, and call the
area covering the text "text overlay".

MozReview-Commit-ID: KWNAwVRP7fN

--HG--
extra : rebase_source : 674dbec65e1c4b04413f9f35fe46aeea46480831
2016-08-14 20:22:04 +08:00
Ting-Yu Lin
02f58e267d Bug 1292904 Part 1 - Use element id to get caret child element. r=mtseng
The children of the caret element already have unique class name like
"image" or "bar", we could change the class name to be id, and use id to
locate them.

MozReview-Commit-ID: HLZecyAEYXv

--HG--
extra : rebase_source : 04b59a4d639ad45d2b564f48de15c2f23752fdaf
2016-08-18 15:09:19 +08:00
Ting-Yu Lin
6346d9e755 Bug 1293950 - Update mozilla wiki link in AccessibleCaret headers. r=mtseng
Change only comments so DONTBUILD (NPOTB).

MozReview-Commit-ID: 3UOtYyOxg3

--HG--
extra : rebase_source : 242ed41c006ce13c3f148a4d165f5c64f43b7cbb
2016-08-10 15:46:27 +08:00
Kartikaya Gupta
e0f363fe61 Bug 1255555 - When a frame reconstruction triggers caret elements to be cloned, ensure the dummy touch listeners are re-registered on the clones. r=tylin
MozReview-Commit-ID: 8txWmd64LC9
2016-07-11 08:16:39 -04:00
Ting-Yu Lin
9410058023 Bug 1246918 - Handle PresShell gone after FlushLayout(). r=roc
After calling FlushLayout(), PresShell::Destroy() might be called and we
should consider PresShell and other resources will be no longer valid.

Before this patch, AccessibleCaretManager and AccessibleCaret(s) are
deallocated in PresShell::Destroy(). However FlushLayout() are all
invoked in AccessibleCaretManager, we need to keep manager alive to
clean up after PresShell::Destroy().

This patch makes AccessibleCaretManager live after PresShell::Destroy(),
and use IsTerminated() to check whether PreShell is vaild after each
FlushLayout() calls.

Note that event though AccessibleCaretEventHub will be unref in
PresShell::Destroy(), all the callers to AccessibleCaretEventHub's
public methods already add a ref to AccessibleCaretEventHub. So we don't
need to worry about AccessibleCaretEventHub and AccessibleCaretManager
die immediately after PresShell::Destroy().

MozReview-Commit-ID: DDpXZ7v3zyo

--HG--
extra : rebase_source : 280e2512fb9f28d933f5b8d65a9f303ac81c58e5
extra : source : 10e71da98b144fbf42aaa81a1056910a3766a6cb
2016-02-15 15:12:35 +08:00
Carsten "Tomcat" Book
a363262826 Merge mozilla-central to mozilla-inbound 2016-02-17 14:37:20 +01:00
Carsten "Tomcat" Book
8cbc76d2fd Backed out changeset 10e71da98b14 (bug 1246918) 2016-02-17 14:34:49 +01:00
Ting-Yu Lin
585b41e8b5 Bug 1246918 - Handle PresShell gone after FlushLayout(). r=roc
After calling FlushLayout(), PresShell::Destroy() might be called and we
should consider PresShell and other resources will be no longer valid.

Before this patch, AccessibleCaretManager and AccessibleCaret(s) are
deallocated in PresShell::Destroy(). However FlushLayout() are all
invoked in AccessibleCaretManager, we need to keep manager alive to
clean up after PresShell::Destroy().

This patch makes AccessibleCaretManager live after PresShell::Destroy(),
and use IsTerminated() to check whether PreShell is vaild after each
FlushLayout() calls.

Note that event though AccessibleCaretEventHub will be unref in
PresShell::Destroy(), all the callers to AccessibleCaretEventHub's
public methods already add a ref to AccessibleCaretEventHub. So we don't
need to worry about AccessibleCaretEventHub and AccessibleCaretManager
die immediately after PresShell::Destroy().

MozReview-Commit-ID: DDpXZ7v3zyo

--HG--
extra : rebase_source : 2698f0313e394b64ff8caacf21493c874510a7ce
2016-02-15 15:12:35 +08:00
Ting-Yu Lin
19677da566 Bug 1248309 - Fix caret size not updated when only zoom level is changed. r=roc
On Fennec, it's possible that after automatically zooming an editable
input, the mImaginaryCaretRect for the caret remains the same. Only the
zoom level is changed. Therefore, the zoom level should also be
considered to determine whether the position is changed or not so that
the caret can get updated.

MozReview-Commit-ID: CrictS4S0Yl

--HG--
extra : rebase_source : f26f89cb72a9ae8a55104054121486a67e841513
2016-02-15 18:29:32 +08:00
Ting-Yu Lin
b48a4c37c2 Bug 1225701 - Update comments in AccessibleCaret files. r=mtseng
DONTBUILD NPOTB

--HG--
extra : commitid : LWzB3w73OeN
extra : rebase_source : 4e359bda2a8c005eedf2ebf972182111094e809e
2015-11-18 11:44:00 +08:00
Nathan Froyd
01583602a9 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

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Ting-Yu Lin
549ac3b8f4 Bug 1204872 - Prettify enum class printing. r=roc
Provide operator<< functions so that gtest can use them to print enum
classes.

--HG--
extra : commitid : JYu6ffen2Zr
extra : rebase_source : 6628de44b343a0c625fd4526d36dba34ad0cb5cc
2015-09-19 01:05:19 +08:00
Ting-Yu Lin
7d5437ce32 Bug 1204872 - Make AccessibleCaret testable. r=roc
Remove the assert of the existence of PresShell in the constructor since
there's no PresShell in gtest. Also make AccessibleCaret inheritable.

--HG--
extra : commitid : JudUoXt9auc
extra : rebase_source : 882f017063339c2fb2313459d9a9f2f7c1549071
2015-09-19 01:05:18 +08:00
Bobby Holley
97b9240b34 Bug 1188696 - Hoist nsRefPtr.h into MFBT. r=froydnj 2015-07-29 10:44:59 -07:00
Ting-Yu Lin
2a47a562fb Bug 1161392 - Enlarge touch area for AccessibleCaret. r=roc
Porting the patch for Touch/SelectionCarets in bug 1021499 to
AccessibleCaret.
2015-05-27 16:37:28 +08:00
Ting-Yu Lin
053054ff69 Bug 1068525 - Ignore zoom level for AccessibleCaret. f=mtseng, r=roc
We want AccessibleCaret be of the same size regardless of the zoom
level. We simply divide the caret's width, height, margin-left, and the
text selection bar's margin-left by current zoom level.

The margin-left of the caret is adjusted from -23px to -23.5px for better
looking.
2015-05-16 00:05:00 +08:00
Ting-Yu Lin
034c5058c3 Bug 1110039 - Part 2.2 - Add AccessibleCaret. r=roc
See AccessibleCaret.h for the class description.

Technical difference between AccessibleCaret and Touch/SelectionCarets:
The anonymous dom element containing a caret image will be created by
AccessibleCaret by using the API landed in bug 1020244 instead of being
created by nsCanvasFrame.
2015-05-04 21:25:00 +02:00