Граф коммитов

243 Коммитов

Автор SHA1 Сообщение Дата
Noemi Erli 13b7594c46 Backed out 2 changesets (bug 1306634) for causing assertion failures in nsAutoLayoutPhase.cpp CLOSED TREE
Backed out changeset fb20602d0c39 (bug 1306634)
Backed out changeset 35651fd9e240 (bug 1306634)
2020-01-17 01:01:09 +02:00
Ting-Yu Lin 2e68f8780b Bug 1306634 Part 1 - Handle a long press to select a word in an unfocused iframe. r=mats,marionette-reviewers,whimboo
Long-pressing on a text in an unfocused iframe to select a word never
works. Currently, you need to single tap to focus the iframe first.

Each PresShell has an associated AccessibleCaretEventHub. This patch
fixes this bug by routing the event to the AccessibleCaretEventHub under
the event point, and handle it there. If the event is not handled, then
we handle it by the focused AccessibleCaretEventHub as before.

I've experimented with only routing the event to the
AccessibleCaretEventHub under the event point, without routing to the
fallback focused AccessibleCaretEventHub. However, caret dragging didn't
work in iframes. I didn't debug further.

Differential Revision: https://phabricator.services.mozilla.com/D52767

--HG--
extra : moz-landing-system : lando
2020-01-16 05:08:36 +00:00
Sebastian Streich 0df7a35f3c Bug 1602487 - Remove GetURI calls in PresShell.cpp r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D58790

--HG--
extra : moz-landing-system : lando
2020-01-09 12:09:18 +00:00
Ting-Yu Lin 391acfb3c7 Bug 1604701 - Make EventTargetData::mPresShell always compute from the frame. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D57601

--HG--
extra : moz-landing-system : lando
2019-12-19 17:08:41 +00:00
Emilio Cobos Álvarez 3405fe8b57 No bug - Remove a useless include in PresShell.h. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D57690

--HG--
extra : moz-landing-system : lando
2019-12-18 22:57:48 +00:00
Gurzau Raul fb5285c3cd Backed out changeset c6d6f7799ed7 requested by emilio on a CLOSED TREE. 2019-12-19 00:49:07 +02:00
Emilio Cobos Álvarez e0d010d688 No bug - Remove to useless includes in PresShell.h. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D57690

--HG--
extra : moz-landing-system : lando
2019-12-18 22:40:47 +00:00
Masayuki Nakano 271d1b6d1d Bug 1543315 - part 20: Mark `PresShell::ContentStateChanged()` as `MOZ_CAN_RUN_SCRIPT_BOUNDARY` r=smaug
While it calls `RestyleManager::ContentStateChanged()`, it blocks script
with `nsAutoCauseReflowNotifier`.  Therefore, it should be marked as
`MOZ_CAN_RUN_SCRIPT_BOUNDARY` at least (looks like the other override,
`DocAccessible::ContentStateChanged()` does not run script).

There is a concern about the lifetime of `RestyleManager`.  It's destroyed
when `nsPresContext::DetachPresShell()` is called.  It's called by
`PresShell::Destroy()` and destructor of `nsPresContext`.  The latter is
safe since `PresShell` owns `mPresContext` and it's never cleared.  However,
I'm not sure about the former.  It might be better to create blocker of
synchronous handling of `PresShell::Destroy()`.

And also this does not make `Document::ContentStateChanged()` use
`RefPtr<PresShell>` at calling it because it might cause performance
regression, but it does not do anything after destroying
`nsAutoCauseReflowNotifier`.

Finally, for guaranteeing that the lifetime of `PresShell::mPresContext` is
longer than `PresShell`, this makes it to `RefPtr<nsPresContext> const`.
However, initializing it in constructor breaks other objects' initialization
process since they assume that `PresShell::GetPresContext()` won't return
valid pointer until the `nsPresContext` is attached.  For solving this issue
safe, this patch keeps setting `mPresContext` in `Init()` with `const_cast`
hack.

Differential Revision: https://phabricator.services.mozilla.com/D55804

--HG--
extra : moz-landing-system : lando
2019-12-11 12:18:33 +00:00
Masayuki Nakano d586d5dc73 Bug 1543315 - part 19: Mark `PresShell::ReconstructFrames()` as `MOZ_CAN_RUN_SCRIPT` r=smaug
It calls `Document::FlushPendingNotification()` so that we should mark it
as `MOZ_CAN_RUN_SCRIPT`.

And the method calls it of `mDocument` and `mDocument` is never modified
after it's initialized.  Therefore, we can move the initializer to the
constructor and make `RefPtr<Document>` to `RefPtr<Document> const`.  Thus,
we can avoid unnecessary auto `RefPtr`.

Differential Revision: https://phabricator.services.mozilla.com/D55803

--HG--
extra : moz-landing-system : lando
2019-12-11 12:18:00 +00:00
Masayuki Nakano 33564215e6 Bug 1543315 - part 18: Mark `PresShell::FireResizeEvent()` as `MOZ_CAN_RUN_SCRIPT` r=smaug
It dispatches a DOM event so that it should be marked as `MOZ_CAN_RUN_SCRIPT`.

Differential Revision: https://phabricator.services.mozilla.com/D55801

--HG--
extra : moz-landing-system : lando
2019-12-11 12:17:17 +00:00
Gabriele Svelto 69790bc62e Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55443

--HG--
extra : moz-landing-system : lando
2019-12-06 09:16:44 +00:00
Hiroyuki Ikezoe 7afdb8487c Bug 1586986 - Fire visual viewport resize events and flush position:fixed elements' layout in the same way what Chrome does. r=botond
On Chrome, visual viewport resize event is fired repeatedly during dynamic
toolbar transitions and visual viewport height obtained by the VisualViewport
API is also changed, but in terms of layout the height value is never used
until the dynamic toolbar height reaches to zero or is changed from zero.
The height used at the time is the height for vh units when the toolbar height
reaches to zero and the ICB height when the toolbar height is changed from zero.
To do so, we need to have another visual viewport size in parallel to the
original one and use them depending on situations.

Differential Revision: https://phabricator.services.mozilla.com/D52338

--HG--
extra : moz-landing-system : lando
2019-11-21 21:36:59 +00:00
Dan Glastonbury 196b08c653 Bug 1578319: Telemetry for total time spent in layout per Refresh Driver tick. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D44427

--HG--
extra : moz-landing-system : lando
2019-11-01 04:33:48 +00:00
Sylvestre Ledru f12b9fa5c3 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D47737

--HG--
extra : moz-landing-system : lando
2019-10-06 18:29:55 +00:00
Emilio Cobos Álvarez 848d89d65f Bug 1583534 - Further simplify PresShell::ResizeReflow. r=botond
In particular, not let ResizeReflow take the old and new size. Most of the
callers pass dummy values anyway.

Instead, use the old size of the layout viewport. This ensures we fire resize
events only if the layout viewport actually changes.

This is important because the first resize of the mobile viewport manager
after a navigation has an "old size" of 0x0, even though the layout viewport
is initialized on presshell initialization to the right size.

Thus, we fire resize events unnecessarily in that case, which is the root cause
for bug 1528052.

To do this, we need to shuffle a bit of code in nsDocumentViewer that deals with
delayed resizes, to set the visible area _and_ invalidate layout, rather than
setting the visible area and _then_ relying on doing a resize reflow.

Further cleanup is possible, though not required for my android resizing fix, so
will do separately.

Differential Revision: https://phabricator.services.mozilla.com/D46944

--HG--
extra : moz-landing-system : lando
2019-09-25 19:12:44 +00:00
Botond Ballo 88ed171110 Bug 1577859 - Additional post container scrolling removal cleanup in Layout code. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D45596

--HG--
extra : moz-landing-system : lando
2019-09-15 21:51:41 +00:00
Emilio Cobos Álvarez f94e56699a Bug 1577258 - Add a simpler resize reflow function for when we're not shrink-wrapping. r=bzbarsky
This is much easier than the existing ResizeReflowIgnoreOverride function, and
this will allow me to avoid flushing if needed (we already kinda do that
already with the "suppressResizeReflow" thing), which in turn allows me to
consolidate a bunch of the logic for resizes.

The function should be much easier to follow:

 * Set the new viewport (async, doesn't do any work).
 * Invalidate layout as needed due to the viewport change (that is, resize hint
   for the root frame, and invalidate isizes if needed). Also async and doesn't
   do any reflowing itself.
 * Flush layout / do the reflowing all at once. I think we can stop doing this
   much more often now, but that's follow-up work.



Depends on D43798

Differential Revision: https://phabricator.services.mozilla.com/D43799

--HG--
extra : moz-landing-system : lando
2019-09-13 00:21:04 +00:00
Dan Glastonbury 41fff20f69 Bug 1571612 - P2: Collect flush req and flush telemetry. r=heycam
Collect telemetry for the number of pending style and layout flush requests per
flush and the number of style and layout flushes per nsRefreshDriver::Tick.  A
style flush reports only style requests, but a layout flush reports style and
layout requests since flushing layout implies a style flush also.

Differential Revision: https://phabricator.services.mozilla.com/D40756

--HG--
extra : moz-landing-system : lando
2019-08-21 01:43:30 +00:00
Emilio Cobos Álvarez 5ab3251196 Bug 1528616 - Move PresShell::GetRectVisibility to nsTypeAheadFind.cpp. r=dholbert
nsTypeAheadFind.cpp contains all of the callsites to this function, so it seems like a logical place for it to live.

Differential Revision: https://phabricator.services.mozilla.com/D40696

--HG--
extra : moz-landing-system : lando
2019-08-07 11:21:55 +00:00
Emilio Cobos Álvarez 937b1f9834 Bug 1566783 - Don't prevent PresShell::ScrollToAnchor() from working due to scroll anchoring adjustments that happen without the user scrolling. r=dholbert
We were bailing out because scroll anchoring adjustments can make this check
fail:

  * https://searchfox.org/mozilla-central/rev/22b330ecb3edba1536a54887060cbdd09db21c59/layout/base/PresShell.cpp#3194

Differential Revision: https://phabricator.services.mozilla.com/D38397

--HG--
extra : moz-landing-system : lando
2019-07-20 15:02:35 +00:00
Emilio Cobos Álvarez d1a9b44ea6 Bug 1560188 - Fix and improve display list memory reporting. r=mattwoodrow,njn
I missed in bug 1487216 that the pres arena memory reporting assumes that the
entry indices are frame class ids, which means that we're reporting some display
list arena entries as frames, which is obviously wrong.

Cleanup a bit nsPresArena to remove the custom id concept, and report also
individual display item type memory usage.

Differential Revision: https://phabricator.services.mozilla.com/D35368

--HG--
extra : moz-landing-system : lando
2019-07-02 02:46:09 +00:00
Miko Mynttinen fbfcf25cc9 Bug 1490404 - Part 1: Be more consistent with display list and display list builder pointers and references r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D33679

--HG--
extra : moz-landing-system : lando
2019-06-06 17:54:13 +00:00
Jonathan Watt 5cd2b5b11e Bug 1557104. Merge nsIPageSequenceFrame and nsSimplePageSequenceFrame. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D33817

--HG--
rename : layout/generic/nsSimplePageSequenceFrame.cpp => layout/generic/nsPageSequenceFrame.cpp
rename : layout/generic/nsSimplePageSequenceFrame.h => layout/generic/nsPageSequenceFrame.h
extra : rebase_source : e75b043af4dbfe4c108f2bfc0e234fd20c5af315
2019-05-22 13:01:33 +01:00
Ehsan Akhgari a9e9f5ccdb Bug 1415270 - Part 1: Move nsHTMLDocument editing APIs to Document; r=farre,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D32911

--HG--
extra : moz-landing-system : lando
2019-05-31 01:37:26 +00:00
Edgar Chen 33d303678c Bug 1543439 - Part 2: Move is-user-interaction checks out of PresShell::EventHandler::PrepareToDispatchEvent; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D32019

--HG--
extra : moz-landing-system : lando
2019-05-27 10:14:06 +00:00
Botond Ballo 9ef9fc2fd8 Bug 1554794 - Add PresShell::UsesMobileViewportSizing() and use it in place of GetIsViewportOverridden() where appropriate. r=kats,hiro
With desktop zooming, we need to separate the concepts of "may have a distinct
visual viewport" from "has mobile viewport sizing logic applied to it".

This can be thought of as completing the disentanglement of zooming from meta
viewport support started in bug 1459260.

Differential Revision: https://phabricator.services.mozilla.com/D32770

--HG--
extra : moz-landing-system : lando
2019-05-28 13:31:59 +00:00
Hiroyuki Ikezoe a7b7f105b5 Bug 1541253 - Propagate CSS visivibility information to descendant documents. r=tnikkel
Depends on D26251

Differential Revision: https://phabricator.services.mozilla.com/D26252

--HG--
extra : moz-landing-system : lando
2019-05-10 11:15:43 +00:00
Hiroyuki Ikezoe 88e1c00d24 Bug 1541253 - Make PresShell::IsVisible const. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D26251

--HG--
extra : moz-landing-system : lando
2019-05-10 11:15:30 +00:00
Masayuki Nakano 1fb845d129 Bug 1543315 - part 17: Mark PresShell::HandleDOMEventWithTarget() as MOZ_CAN_RUN_SCRIPT r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D30494

--HG--
extra : moz-landing-system : lando
2019-05-09 20:21:28 +00:00
Botond Ballo 65317978a2 Bug 1516722 - Update usage notes for nsIPresShell::ScrollToVisual(). r=kats
Differential Revision: https://phabricator.services.mozilla.com/D30106

--HG--
extra : moz-landing-system : lando
2019-05-07 03:04:06 +00:00
Masayuki Nakano 41c520d31f Bug 1543315 - part 16: Mark PresShell::HandleEventWithTarget() as MOZ_CAN_RUN_SCRIPT r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D30011

--HG--
extra : moz-landing-system : lando
2019-05-06 13:15:05 +00:00
Masayuki Nakano 780b285e68 Bug 1543315 - part 15: Mark PresShell::ScrollFrameRectIntoView() as MOZ_CAN_RUN_SCRIPT r=smaug
Unfortunately, `EventChainVisitor` does not grab the `nsPresContext` with
`RefPtr` by itself.  Therefore, there is no guarantee of the lifetime without
checking the origin when its subclasses are instantiated.  This patch changes
it and subclasses to `MOZ_STACK_CLASS` since only `EventDispatcher::Dispatch()`
creates them in the stack with given `nsPresContext`.  Additionally, it's
already been marked as MOZ_CAN_RUN_SCRIPT_BOUNDARY`.  Therefore, the
`nsPresContext` instance has already been guaranteed its lifetime by the
caller.  For making this fact stronger, this patch marks their constructors
as `MOZ_CAN_RUN_SCRIPT`.  Therefore, nobody can create those instances without
guaranteeing the lifetime of `nsPresContext` and `dom::Event`.  Note that
it may look like that `mPresContext` of `EventChainPostVisitor` is not
guaranteed.  However, `EventChainPreVisitor` which gives `nsPresContext` to it
is also a stack only class.  So, it won't be deleted before
`EventChainPostVisitor` instance.

Differential Revision: https://phabricator.services.mozilla.com/D30010

--HG--
extra : moz-landing-system : lando
2019-05-06 13:57:46 +00:00
Masayuki Nakano 4fd67bb3f1 Bug 1543315 - part 14: Mark PresShell::WillPaintWindow() and PresShell::DidPaintWindow() as MOZ_CAN_RUN_SCRIPT r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D30009

--HG--
extra : moz-landing-system : lando
2019-05-06 13:01:48 +00:00
Masayuki Nakano 8d503c6d14 Bug 1543315 - part 13: Mark PresShell::Paint() as MOZ_CAN_RUN_SCRIPT r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D30008

--HG--
extra : moz-landing-system : lando
2019-05-06 13:25:35 +00:00
Masayuki Nakano c842b7b133 Bug 253889 - part 4: Finally, get rid of nsIPresShell r=emilio
And also this cleans up some legacy comments of PresShell users.

Differential Revision: https://phabricator.services.mozilla.com/D29313

--HG--
extra : moz-landing-system : lando
2019-05-01 02:28:59 +00:00
Masayuki Nakano 8a9d031686 Bug 253889 - part 3: Move all remaining members of nsIPresShell to mozilla::PresShell r=emilio
Additionally, this sorts out the order of member variables for minimizing the
instance size.

And also this changes `enum RenderFlags` to `enum class RenderingStateFlags`.

Differential Revision: https://phabricator.services.mozilla.com/D29312

--HG--
extra : moz-landing-system : lando
2019-05-01 02:28:25 +00:00
Masayuki Nakano 1c74a4dc50 Bug 253889 - part 2: Move all methods and public structs of nsIPresShell into mozilla::PresShell r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29311

--HG--
extra : moz-landing-system : lando
2019-05-01 02:27:53 +00:00
Masayuki Nakano 14b7642127 Bug 1547422 - Make widget use mozilla::PresShell directly rather than via nsIPresShell r=jmathies
This patch makes widget use `mozilla::PresShell` directly rather than via
`nsIPresShell` and changes some pure virtual methods of `nsIPresShell` which
called by widget to `mozilla::PresShell`'s non-virtual methods.

Differential Revision: https://phabricator.services.mozilla.com/D29112

--HG--
extra : moz-landing-system : lando
2019-05-01 18:52:59 +00:00
Masayuki Nakano c2709a0087 Bug 1547535 - Move all a11y code in nsIPresShell to mozilla::PresShell r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D29196

--HG--
extra : moz-landing-system : lando
2019-04-30 07:53:20 +00:00
Masayuki Nakano 36e5df54ec Bug 1547621 - Move all inline methods of nsIPresShell into mozilla::PresShell r=smaug
And also this patch moves some related methods which use the inline methods
and member variables used only by them.

Differential Revision: https://phabricator.services.mozilla.com/D29201

--HG--
rename : layout/base/nsIPresShellInlines.h => layout/base/PresShellInlines.h
extra : moz-landing-system : lando
2019-04-30 01:52:53 +00:00
Masayuki Nakano 2f69dfdd5d Bug 1547536 - Make PresShell QI-able for aware of do_QueryReferent() r=smaug
There is the following usage of nsIPresShell:
```
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShellWeak);
```

So, for changing this to:
```
RefPtr<PresShell> presShell = do_QueryReferent(mPresShellWeak);
```

PresShell should have its own IID.

Differential Revision: https://phabricator.services.mozilla.com/D29197

--HG--
extra : moz-landing-system : lando
2019-04-30 00:56:14 +00:00
Masayuki Nakano f3bcf4c6d1 Bug 1547418 - Make CapturingContentInfo a private struct of PresShell and move APIs for it from nsIPresShell to PresShell r=smaug
`CapturingContentInfo` struct is used only in `PresShell.cpp` so that we can
make it a private struct of `PresShell` if we move all users of them,
i.e., API to access them, from `nsIPresShell` to `PresShell`.

Differential Revision: https://phabricator.services.mozilla.com/D29111

--HG--
extra : moz-landing-system : lando
2019-04-30 00:26:57 +00:00
Botond Ballo 32567fa488 Bug 1529892 - Move the clearing of a pending visual scroll update to the end of the paint. r=kats
The fixes a latent bug with WebRender where we would clear it after reading it
in ComputeScrollMetadata, but WR would sometimes call ComputeScrollMetadata a
second time for the same scroll frame in the same transaction, resulting in
the update sometimes not making it into the transaction.

Differential Revision: https://phabricator.services.mozilla.com/D28776

--HG--
extra : moz-landing-system : lando
2019-04-26 05:14:00 +00:00
Emilio Cobos Álvarez 1c3126eaaa Bug 1545699 - Track editor stylesheets better. r=masayuki
Replacing the whole set of user-agent stylesheets seems a bit overkill.

Differential Revision: https://phabricator.services.mozilla.com/D28212
2019-04-25 14:00:01 +02:00
Masayuki Nakano 2933c032e7 Bug 1545342 - part 3: Move remaining public enum of nsIPresShell to mozilla namespace in mozilla/PresShellForwards.h and make them enum class r=smaug
This patch moves remaining public `enum` of `nsIPresShell` to `mozilla`
namespace in `mozilla/PresShellForwards.h` and make them `enum class`es.

Additionally, some methods which use the moving `enum`s from `nsIPresShell`
to `PresShell`.

Differential Revision: https://phabricator.services.mozilla.com/D28607

--HG--
extra : moz-landing-system : lando
2019-04-25 05:04:23 +00:00
Masayuki Nakano 3622509485 Bug 1545342 - part 2: Make some public enum of nsIPresShell move to mozilla namespace and defined as enum class in PresShellForwards.h r=smaug
This patch moves some `enum` in `nsIPresShell` which are in public scope into
`mozilla` namespace and change them as `enum class`es.

Unfortunately, only "where to scroll" enum is just defines constants of
percentages of scroll destination.  Therefore, this patch makes only them
as `static const`.

Differential Revision: https://phabricator.services.mozilla.com/D28606

--HG--
extra : moz-landing-system : lando
2019-04-25 05:04:15 +00:00
Masayuki Nakano 5932f01d53 Bug 1545342 - part 1: Create mozilla/PresShellForwards.h and move global enums/constants in nsIPresShell.h and mozilla/PresShell.h into the new one r=smaug
This patch creates new header, `mozilla/PresShellForwards.h`.  It should have
all forward declarations of global class/struct in `nsIPresShell.h` and
`mozilla/PresShell.h`.

Additionally, this moves all `enum`s and `constant`s in them into the new file
with changing them to `enum class`es.

This will make other headers which require only specific types in the header
files not include them.

Differential Revision: https://phabricator.services.mozilla.com/D28605

--HG--
extra : moz-landing-system : lando
2019-04-25 05:02:20 +00:00
Masayuki Nakano 530d2600c3 Bug 1543315 - part 12: Mark nsIPresShell::DoScrollContentIntoView() as MOZ_CAN_RUN_SCRIPT r=smaug
Now, we can mark `DoScrollContentIntoView()` as `MOZ_CAN_RUN_SCRIPT` and move
it from `nsIPresShell` to `PresShell` with a member.

Differential Revision: https://phabricator.services.mozilla.com/D28321

--HG--
extra : moz-landing-system : lando
2019-04-23 01:34:26 +00:00
Masayuki Nakano 3bd62fb08a Bug 1543315 - part 11: Mark nsIPresShell::ScrollContentIntoView() as MOZ_CAN_RUN_SCRIPT r=smaug
This patch marks `ScrollContentIntoView()` as `MOZ_CAN_RUN_SCRIPT` and changing
some callers of them to guarantee thar their parent callers are also safe.

Additionally, this patch moves it from `nsIPresShell` to `PresShell` because
all callers can refer `PresShell` directly.

Unfortunately, this patch changes a lot of methods in autocomplete and satchel
since this patch needs to mark some interface methods as `can_run_script` and
they are called each other.  This means that autocomplete module is really
sensitive like editor module.  Perhaps, autocomplete and satchel should do
scroll asynchronously and unmark some of them as `MOZ_CAN_RUN_SCRIPT` again.

Differential Revision: https://phabricator.services.mozilla.com/D28320

--HG--
extra : moz-landing-system : lando
2019-04-23 01:34:24 +00:00
Masayuki Nakano 65aa369673 Bug 1543315 - part 10: Mark nsIPresShell::GoToAnchor() and nsIPresShell::ScrollToAnchor() as MOZ_CAN_RUN_SCRIPT r=smaug
Next, we should mark `PresShell::ScrollContentIntoView()` as
`MOZ_CAN_RUN_SCRIPT` because it's used widely.

This patch marks its `PresShell` users, `GoToAnchor()` and `ScrollToAnchor()`,
as `MOZ_CAN_RUN_SCRIPT`.  Additionally, this patch moves them from
`nsIPresShell` to `PresShell` because all callers refers `PresShell` directly.

Differential Revision: https://phabricator.services.mozilla.com/D28319

--HG--
extra : moz-landing-system : lando
2019-04-23 01:27:47 +00:00