nsIFrame::mClass is of type enum class nsQueryFrame::ClassID which is
a strict subset of the nsQueryFrame::FrameIID values. For a concrete
frame class, its FrameIID is the same numeric value as its ClassID.
MozReview-Commit-ID: 1N0AkCGo1ol
In bug 1359868 we started to do this, but we bounded the pre-render region for
the entire scrollbar by the widget bounds, which is not helpful for tall
scrollframes with short thumbs.
This time, we are bounding the pre-render region of the thumb only, so a small
thumb will always be completely painted.
MozReview-Commit-ID: 5LuP5Lfahdm
--HG--
extra : rebase_source : 3ab45f979160d7991aec71020cf57c9a1e57d1ce
Also add a comment to AsyncDragMetrics documenting that mScrollbarDragOffset
is relative to the thumb's start offset.
MozReview-Commit-ID: uipsOCzs2N
--HG--
extra : rebase_source : 25183e22cb7ffb9995a2594d6aea106cdef7924a
To conserve space in LayerAttributes, we only store the extents along the
relevant axis.
MozReview-Commit-ID: GAL8Oa2NOde
--HG--
extra : rebase_source : 9420d0fb36175e190cbff6e162fd41d8e5240c81
This flag is set to false if there are any conditions that only the main
thread knows about that prevent the thumb from being async-dragged.
MozReview-Commit-ID: Gl7f7bY0QnA
--HG--
extra : rebase_source : 60ab680a3995e3b5c0e1b4482ca0e7142352bbd2
The patch also renames Layer::SetScrollbarData() to Layer::SetScrollThumbData()
for clarity.
MozReview-Commit-ID: DVwJ3DMl3Zs
--HG--
extra : rebase_source : 7b2bfccf1351c82bb16296635e69d5488c87a50f
Transparency is not handled correctly for composited popups on any platform,
but works with varying degrees of success on some platforms, for some popups.
Oddly, out of the three main desktop platforms, Linux seems to handle it the
best, so long as we render the popup as opaque, and let the platform
compositor handle the transparency.
MozReview-Commit-ID: E8NQlToUQq3
--HG--
extra : rebase_source : c77da6eed1e95769798a14e873798df920fcb9b7
There are several behaviors that we only need to apply to popups which are
known to contain remote content. And since those behaviors can cause issues
elsewhere, we need to be able to identify popups which should contain remote
content, and treat them specially, where appropriate.
MozReview-Commit-ID: EMFrSP8lZiD
--HG--
extra : rebase_source : 5ee9da422081098d8099a048c7704008a06a7241
This avoids conflicts with mozilla::dom::FrameType.
MozReview-Commit-ID: 7aEMbHRaTFk
--HG--
extra : rebase_source : 2d01321f5ce0ec8c0e3f70984674f82678034b3c
The APZ scrolling codepath doesn't do the right thing for <listbox>
without special handling, so have it scroll in JS instead, like we
did in bug 1302736 for <tree>.
MozReview-Commit-ID: LWJCBfhZ3Hc
--HG--
extra : rebase_source : bb8b2f7e713d35822a956e08f4e0eed0557b07b3
Supporting custom scrollbar mediators would require having custom logic in APZ
for each custom mediator. Since custom mediators are only used by legacy XUL
elements (<listbox> and <tree>) that isn't worth implementing.
MozReview-Commit-ID: KtCUvtiR1qn
--HG--
extra : rebase_source : dfd301da4d6877dd636c9719df46409db260d94c
The flush was added due to the overflow/underflow events causing recursion in some cases. But if the events aren't fired there is no point in doing this. The password manager test is changed to flush since it relies on showing/hiding tree columns but currently doesn't wait for a relayout before asking for cell information.
In the new architecture of Quantum DOM, all timer callback need a
specified event target. So, we add the new document arg to Start
function to get the event target from it. And update all callers.
MozReview-Commit-ID: a482mukqGc
--HG--
extra : rebase_source : 36f9d47a4afd7c7113adf3f274656b694b8d0943
In the new architecture of Quantum DOM, all runnables need a name label.
So, we add the new string-label arg to Start function, and update all
callers.
MozReview-Commit-ID: G9LXFjtFcQv
--HG--
extra : rebase_source : a19b605013be56d01780c831d2a48ada8825b1c7
This patch makes nsRepeatService stop inheriting from nsITimerCallback.
We needed that inheritance for InitWithCallback, but we do not need it
for InitWithFuncCallback.
This patch also makes nsRepeatService singly-owned instead of being
refcounted, since we're left with only a single owning pointer.
MozReview-Commit-ID: Fl8beVC8kGH
--HG--
extra : rebase_source : 3b6223c8e4754a90d2fef460940fda4510310f95
This was added in
https://hg.mozilla.org/mozilla-central/rev/9eabf947efc3363a1bf79aa03c3053d184510846
for https://bugzilla.mozilla.org/show_bug.cgi?id=957445#c29 but the
|aShouldRepaint| out parameter is not handled, and the call has no side
effects.
WidgetStateChanged() in nsNativeThemeWin and nsNativeThemeCocoa do not request
repaint of the scrollbar nor otherwise handle curpos.
nsNativeThemeGTK::WidgetStateChanged() requests a repaint on some changes in
curpos only on scrollbar buttons.
MozReview-Commit-ID: 98iyhLMs7ja
--HG--
extra : rebase_source : 512e0d9e825975a33fadd51e7c69d1ea0fa1cbef
Note that we still use InitWithCallback() instead of upgrading to
InitWithNamedFuncCallback(). This is because they have different lifetime
implications for the callback arg that nsMenuFrame passes in, mTimerMediator.
So to label the callback with InitWithCallback(), we make nsMenuTimerMediator
inherit from nsINamed to provide the label via that API's GetName method.
MozReview-Commit-ID: 45c6kDF2xCJ
--HG--
extra : rebase_source : 82a50ae01c6d23b7c495cc1ded68a27001631cff
This ensures that the pointer is always either null or a valid nsIContent after
the call to Rollup returns, and avoids potentially leaving it as garbage. An
alternative approach would be to make the call sites responsible for ensuring it
is set to nullptr if the function returns false, but this seems safer.
MozReview-Commit-ID: BXxPBgs6MZL
--HG--
extra : rebase_source : 89ab9984db5114595e581c98a049a0000ea19307
The relevant frame classes are:
SubDocumentFrame
ListControlFrame (only when used for (non-e10s?) comboboxes)
PluginFrame
ViewportFrame
MenuPopupFrame
The view is now created in the frame's Init() method, except for
ViewportFrame which has its view assigned by the frame constructor
via a SetView() call.
MozReview-Commit-ID: 4O7Hm1yqwIp
Views are used for PluginFrame which inherits nsFrame, not nsContainerFrame,
so it's more appropriate that these methods should live in nsIFrame/nsFrame.
MozReview-Commit-ID: 87EgCnkF5YT
This just decouples nsAutoRollup from the widget class, which it isn't really
bound to anyway because the internal data is static. We'll need to be able to
use nsAutoRollup independently in the next patch.
MozReview-Commit-ID: 1dxSLTr4g1K
--HG--
extra : rebase_source : 6f6964ca046b6f88e5c99c944a08b1c563f17837
This patch is written by the following script with some manual adjustment to
the comment in nsRubyTextContainerFrame.cpp and nsRubyFrame.cpp, and
nsColumnSetFrame's constructor.
function rename() {
find layout\
-type f\
\( -name "*.cpp" -or\
-name "*.h" \)\
-exec sed -i -r "s/$1/$2/g" "{}" \;
}
rename "nsReflowStatus *([a-zA-Z0-9]*) = NS_FRAME_COMPLETE" "nsReflowStatus \1"
rename "([a-zA-Z0-9.*]*) *= NS_FRAME_COMPLETE;" "\1.Reset();"
rename "([a-zA-Z0-9.*]*) == NS_FRAME_COMPLETE" "\1.IsEmpty()"
MozReview-Commit-ID: 9tqQAHvdQex
--HG--
extra : rebase_source : 3119776946dc2c8350098b7bf9f3ceff29bdffb5
Weak frames are stored in a linked list, so are not fast. Hence they are not meant to be used when there can be a lot of them active at the same time. When constructing large selects with lots of options we create one for every option.
There's no need to use a weak frame for a reflow callback as we can just cancel the reflow callback in the Destroy function.
This is the bulk of the changes.
- DisplayItemScrollClip is removed. Instead, we will have 1) ActiveScrolledRoot
and 2) DisplayItemClipChain.
- ActiveScrolledRoot points to a scroll frame and allows traversing up the
scroll frame chain.
- DisplayItemClipChain is a linked list of clips, each clip being associated
with the ActiveScrolledRoot that moves this clip.
- Each display item has an ActiveScrolledRoot and a clip chain.
- nsDisplayItem::GetClip returns the item of the clip chain that scrolls with
the item's ASR. The separation between "regular clip" and "scroll clips"
mostly goes away.
- Tracking clips in the display list builder's clip state happens very
similarly to how regular clips used to be tracked - there's a clip chain for
content descendants and a clip chain for containing block descendants. These
clip chains are intersected to create the combined clip chain.
- There are strict rules for the ASR of a container item: A container item's
ASR should be the innermost ASR which the item has finite clipped bounds with
respect to.
- At some point in the future, ASRs and AGRs should be reunified, but I haven't
done that yet, because I needed to limit the scope of the change.
MozReview-Commit-ID: KYEpWY7qgf2
--HG--
extra : rebase_source : c727f6300a35463750639e165bfa37374c06b851
During the refactoring of nsSliderFrame::SetCurrentPositionInternal in Bug 957445, one
of the two calls to nsSliderFrame::UpdateAttribute was missed. This resulted in the position,
identified with nsGkAtoms::curpos, not being updated immediately after the call to
nsSliderFrame::SetCurrentThumbPosition
MozReview-Commit-ID: 6gedouG4OFX
--HG--
extra : rebase_source : dd29d90e6f10be87f652241ad138d4533bda1010
Delete the "or 0 for no movement in that direction" from the CanAdjustEdges
document in nsMenuPopupFrame.h because the only caller in nsResizerFrame.cpp
never passes 0 to it.
MozReview-Commit-ID: 3A5A8O4MDn1
--HG--
extra : rebase_source : 3a961f9195d7887f8abb5c31ae9ec088f78a2626
We aren't likely to implement predictive size decoding for XUL images. So instead do some sync decoding when we Draw them at their specified size. This will avoid a paint where we don't draw the image, or draw it at the wrong size, followed later by the correctly sized image.
Original patch by Tyler Maklebust <tmaklebust@gmail.com> and Jared Beach <beachjar@msu.edu>
MozReview-Commit-ID: 7FW6PHIrXF4
--HG--
extra : rebase_source : e8132fc8af91657ca80f18a841101bc1070c8b15
In cases where a mouse click that starts a scrollbar drag is also what
layerizes the scroll frame, the StartAsyncScrollbarDrag message needs to
arrive after the layer transaction. This patch ensures it does.
MozReview-Commit-ID: A02qRb6yWxg
--HG--
extra : rebase_source : 3517e8c8a578a0bd257a80bb8cb81303d171bb6c
This patch makes nsMenuBarListener clear its accesskey state when it receives a "deactivate" event of its top level window and reverts the change of nsMenuBarListener::Blur() by bug 625151.
"blur" event may be caused by focus move in the contents after "mosuedown" event. Therefore, mAccessKeyDownCanceled may be cleared unexpectedly. Listening to "deactive" event keeps bug 625151's fix because it's a bug after deactivating the window with Alt+Tab.
MozReview-Commit-ID: 4mAmXpxmDdv
--HG--
extra : rebase_source : 1bd9299a37bc5a1feccb61ba6c3db6b389560ec0
Let's move the code adding/removing event listers to nsMenuBarListener because it makes what we maintain them easier.
This patch makes nsMenuBarListener store event target which is composed document node of the menubar content as a weak reference but this must be safe because when nsMenuBarFrame (stored as mMenuBarFrame) is being destroyed, OnDestroyMenuBarFrame() which clears the storing event target reference is always called. We should be able to assume that the content and its composed document has never gone before destroying its frame...
MozReview-Commit-ID: DdOtRzUAL1Z
--HG--
extra : rebase_source : bfc337aaad447ad4a9d78b2f3a9e49c72db1498e
test_scroll_snapping_scrollbars.html is failing when apz.drag.enabled
is true because synthesizeMouse does not route events through APZ,
meaning that the drag is never handled by APZ or Gecko.
Resolve this by adding a check that mHandledByApz flag is true for
WidgetGUIEvent, and handle in Gecko if that is not the case.
MozReview-Commit-ID: IrxVLxqs64V
--HG--
extra : rebase_source : c76e9fed3dcab806b17e85740c94339ac0e7ccca
Fix thumb position determination in these places:
- nsSliderFrame::StartAPZDrag() -- Constrain sliderTrack using
GetXULClientRect() to match dimensions used in
SetCurrentThumbPosition() and DoXULLayout(). This is what caused
the scaling/offset mismatch.
- nsSliderFrame::StartAPZDrag() -- Adjust nonsensical calculation of
cssSliderTrack. Should be sliderFrame + scrollbarFramePosition -
compositionBoundsPosition, to get coordinates relative to the same
region as that of APZ event coordinates.
- AsyncDragMetrics -- Make mScrollTrack and mScrollbarDragOffset float
instead of int coordinates.
- AsyncPanZoomController::HandleDragEvent() -- Use
GetAxisLength(scrollTrack) instead of GetAxisEnd(scrollTrack) in
calculation of scrollMax.
- AsyncPanZoomController::HandleDragEvent() -- Only change position on
MOUSE_MOVE.
Additional refactors:
- Rename HitTestingTreeNode::GetScrollSize() to GetScrollThumbLength(),
along with related functions/variables.
- Rename AsyncPanZoomController::GetAxisSize() to GetAxisLength().
- Rename cf to scrollFrame in nsSliderFrame::StartAPZDrag().
MozReview-Commit-ID: CIsU8Pj6qfa
--HG--
extra : rebase_source : 29548fb95ec3e958d903d964753857ee949753ba
This patch was written with the help of the following script. Also, manually
add mozilla qualifier to the enum values in nsStyleCoord.h, gfxRect.h, and
Types.h to make it build.
function rename() {
find .\
-type f\
! -path "./obj*"\
! -path "./.git"\
! -path "./.hg"\
\( -name "*.cpp" -or\
-name "*.h" \)\
-exec sed -i -e "s/$1/$2/g" "{}" \;
}
rename "NS_SIDE_TOP" "eSideTop"
rename "NS_SIDE_RIGHT" "eSideRight"
rename "NS_SIDE_BOTTOM" "eSideBottom"
rename "NS_SIDE_LEFT" "eSideLeft"
MozReview-Commit-ID: 9T0ORsqM6nP
--HG--
extra : rebase_source : 884ad96104c6e9cf6c8b3145d2d3a071ecccfe6a
Per bug 1299753 comment 20, SetFlags() is designed for flag propagation
to continuations during block reflow. To avoid misuse, I expand
SetFlags() directly in the only reasonable caller nsBlackFrame::Init(),
and replace other usages by AddStateBits().
MozReview-Commit-ID: GsbE2Z0Rps1
--HG--
extra : rebase_source : 72a64e9218870d638f67d1b586f533cd7d16c491
The new name makes the sense of the condition much clearer. E.g. compare:
NS_WARN_IF_FALSE(!rv.Failed());
with:
NS_WARNING_ASSERTION(!rv.Failed());
The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.
--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
The main renaming was generated with the following python script:
```
import sys
import re
CAMEL_CASE_REGEX = re.compile(r"(^|_|-)([A-Z])([A-Z]+)")
DISPLAY_REGEX = re.compile(r"\bNS_STYLE_DISPLAY_([^M][A-Z_]+)\b")
def to_camel_case(ident):
return re.sub(CAMEL_CASE_REGEX,
lambda m: m.group(2) + m.group(3).lower(), ident)
def constant_to_enum(constant):
return "StyleDisplay::" + to_camel_case(constant) + ("_" if constant == "NONE" else "")
def process_line(line):
return re.sub(DISPLAY_REGEX,
lambda m: constant_to_enum(m.group(1)), line)
lines = []
with open(sys.argv[1], "r") as f:
for line in f:
lines.append(process_line(line))
with open(sys.argv[1], "w") as f:
for line in lines:
f.write(line)
```
And the following shell commands:
```
find . -name '*.cpp' -exec python display.py {} \;
find . -name '*.h' -exec python display.py {} \;
```
MozReview-Commit-ID: 91xYCbLC2Vf
They are non-standard aliases for "DragEvent" and "KeyboardEvent" that
are not supported by any other UA, and we would like to drop support.
So first let's stop using them ourselves, so we can use telemetry to see
if any sites are using them.
MozReview-Commit-ID: ICC33ORa2st
This patch makes GetBounds(), GetScreenBounds() and GetClientBounds() more
obviously infallible, like existing functions such as GetNaturalBounds() and
GetClientSize(). This results in clearer behaviour in nsCocoaWindow.mm if
Objective C exceptions occur. Along the way, the patch removes some useless
failure checks for these functions.
The patch also removes the NS_IMETHOD from GetRestoredBounds and makes that
function MOZ_MUST_USE.
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.
As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.
--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
This removes the unnecessary setting of c-basic-offset from all
python-mode files.
This was automatically generated using
perl -pi -e 's/; *c-basic-offset: *[0-9]+//'
... on the affected files.
The bulk of these files are moz.build files but there a few others as
well.
MozReview-Commit-ID: 2pPf3DEiZqx
--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
And mCharCode shouldn't be compared with NS_VK_*, nsIDOMKeyEvent::DOM_VK_*. Additionally, when it's compared with a character constant, cast isn't necessary.
MozReview-Commit-ID: JMT614copjG
--HG--
extra : rebase_source : 69ee3c589e5a71c814ec9a40ac3aab39c789c11d
And also WidgetKeyboardEvent::mKeyCode should be compared with NS_VK_* rather than nsIDOMKeyEvent::DOM_VK_*.
MozReview-Commit-ID: IKjQ1nr8XYe
--HG--
extra : rebase_source : 83125cd2523f6b70759f621470aad23b00aae8ae