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

61 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 88b5840556 Bug 1553673 - Round intersection observer percentage margins with NSToCoordRound rather than the default rounder. r=dholbert
The default rounder floors percentages instead of rounding, which can cause
subtle issues.

This is generally desirable for most lengths, AIUI, so that pages don't cause
undesired overflow when using percentage widths and such, but for the
intersection observer root margin, it can cause some annoyance as the percentage
going negative may cause the root rect to be negatively sized and report no
intersection.

This also seems to match Blink[1], though it goes back to the initial
implementation of IntersectionObserver.rootMargin[2].

[1]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc?l=52&rcl=8671a050dd117b730bffbad5838f218fcc024845
[2]: c88a8ad4f1

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

--HG--
extra : moz-landing-system : lando
2019-06-11 19:16:46 +00:00
Emilio Cobos Álvarez bbc403524a Bug 1551716 - Deindent some IntersectionObserver code. r=mstange
Just trying to make it slightly nicer. Probably should get a function to get the
root target document frame.

Will file a bug for fission since I _suspect_ fission is going to do something
about IntersectionObserver.

Depends on D31149

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

--HG--
extra : moz-landing-system : lando
2019-05-15 17:34:30 +00:00
Emilio Cobos Álvarez 415558991d Bug 1551716 - Use ranged-for loop in DOMIntersectionObserver. r=mstange
There's nothing here that should be mutating us (and if there was we'd be hosed
already given the amount of weak pointers we keep around), so this is nicer.

Depends on D31148

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

--HG--
extra : moz-landing-system : lando
2019-05-15 17:33:45 +00:00
Emilio Cobos Álvarez 4d7db14635 Bug 1551716 - Simplify the cross-origin check in IntersectionObserver. r=mstange
Should've no behavior change given the spec issue, but it should read nicer.

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

--HG--
extra : moz-landing-system : lando
2019-05-15 17:32:28 +00:00
Emilio Cobos Álvarez 097c6e63b1 Bug 1505471 - Map intersection observer rects to the right viewport. r=mstange
targetFrame is modified during the intersection computation loop, so it's not
the viewport you want if there are scrollframes around.

The test is the same as iframe-no-root.html but with a wrapping scroller which
triggers this bug.

This code is quite subtle, so will refactor and clean it up in a followup.

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

--HG--
extra : moz-landing-system : lando
2019-05-15 17:29:33 +00:00
Masayuki Nakano de2d589e58 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 15:12:47 +00:00
Dorel Luca 5a0fa68b78 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano 9273f25ce2 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 13:09:26 +00:00
Boris Zbarsky 1c3e10afc5 Bug 1535384 part 1. Eliminate some easy cases of MOZ_CAN_RUN_SCRIPT_BOUNDARY on webidl callbacks. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D23771

--HG--
extra : moz-landing-system : lando
2019-03-19 05:24:39 +00:00
Emilio Cobos Álvarez 8101ae2ea8 Bug 1523071 - Use Rust lengths for margin / padding / inset. r=jwatt
Also for the intersection observer root margin, since it was easier to fix it
up and clean it up than not doing it.

This is the first big step to get rid of nscoord. It duplicates a bit of logic
in nsLayoutUtils since for now max/min-width/height are still represented with
nsStyleCoord, but I think I prefer to land this incrementally.

I didn't add helpers for the physical accessors of the style rect sides that
nsStyleSides has (top/bottom/left/right) since I think we generally should
encourage the logical versions, but let me know if you want me to do that.

Differential Revision: https://phabricator.services.mozilla.com/D17739
2019-02-10 04:11:58 +01:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez f8233b4454 Bug 1456471: Remove nsCSSParser.h. r=xidorn
MozReview-Commit-ID: 4qa7llzCXeR
2018-04-25 10:38:37 +02:00
Blake Kaplan 543e672dd4 Bug 1391154 - Handle edge cases around the borders of IntersectionObservers more consistently. r=dholbert
The old code would ignore mThresholds if we happened to update when the
observed element was edge-adjacent to its root. This could cause spurious
notifications if it happened to run during a CSS transformation. The new code
more closely follows the spec with a slight deviation where the code treats
all values less than the smallest passed-in threshold as equivalent (when
looking at previousIndex). This matches Chrome's implementation and the tests.

MozReview-Commit-ID: 7oAh1EdjMiY

--HG--
extra : rebase_source : 46de4aee9c7da36bd1b41c07fa9b6bbe8ee15dc0
2018-04-10 18:54:01 -07:00
Xidorn Quan 65a9ee4d6a Bug 1448763 part 1 - Make DOMIntersectionObserver use nsStyleSides for mRootMargin, and use Servo code to serialize it. r=emilio
MozReview-Commit-ID: 8RsoLflRtzE

--HG--
extra : rebase_source : 7e9c53dafe473e77087c880ab39e5265638f0f7e
2018-04-05 18:27:33 +10:00
Emilio Cobos Álvarez 8fcda0e92d Bug 1448690: Remove IsStyledByServo. r=xidorn
MozReview-Commit-ID: I3MDbo2Yu7d
2018-03-26 09:39:26 +02:00
Emilio Cobos Álvarez f7522ae728 Bug 1447358: Unifdef the old style system code. r=jwatt
Summary:
This has been automatically generated using:

  http://dotat.at/prog/unifdef/

And:

find $OBJDIR -type f -name '*.h' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

find $OBJDIR -type f -name '*.cpp' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

MozReview-Commit-ID: I4NdKqbMXzJ

Reviewers: jwatt

Bug #: 1447358

Differential Revision: https://phabricator.services.mozilla.com/D779
2018-03-21 10:20:34 +01:00
Dorel Luca f41b03eca9 Backed out changeset 38577c007450 (bug 1424371) for Marionett test failure on testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py. CLOSED TREE 2018-02-19 22:15:23 +02:00
Milan Sreckovic 7571df7e7c Bug 1424371: Use BaseRect access methods instead of member variables in dom/ r=qdot
MozReview-Commit-ID: HXWhggOMIEK

--HG--
extra : rebase_source : 9c9eacf80d2b7f78faa82a1549170b98d12cdaa8
2018-02-19 12:56:10 -05:00
Cameron McCormack cc7db5c40c Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn
MozReview-Commit-ID: 1FZ9VzjcPzN

--HG--
extra : source : de22d220635f8c059834b76f769d5215ab1a8b5b
2018-02-01 15:04:04 +11:00
Olli Pettay 2acfb90235 Bug 1422092 - Revert the changes made by bug 1399603. r=mrbkap 2017-12-10 14:52:49 -05:00
Cameron McCormack c5a3672a18 Bug 1408305 - Use Servo to parse IntersectionObserver rootMargin values. r=xidorn
MozReview-Commit-ID: 4CIXP73kcf2

--HG--
extra : rebase_source : d9b8bdbf374e98d0f2276be129efd7ae49123498
2017-10-16 18:02:16 +08:00
Tobias Schneider 1e70d2c43e Bug 1406102 - [intersection-observer] Calculate areas using int64_t. r=dholbert
--HG--
extra : rebase_source : 00202f13b33d74bb686a3eb8103543e5a68f88d8
2017-10-09 15:08:41 -07:00
Tobias Schneider ec303fba5c Bug 1399603 - [intersection-observer] Stop observing a target when intersection root is deleted. r=mrbkap
--HG--
extra : rebase_source : 2a24e8f42eb493ce8af1b2321cdec422080cf7d0
2017-10-06 07:39:54 -07:00
Tobias Schneider 0a2233f308 Bug 1401416 - [intersection-observer] Let intersection rect be empty if do_QueryFrame(rootFrame) returns null. r=dholbert
--HG--
extra : rebase_source : c61df51637850211f0c3cbd74fb1ac6c6831cd7e
2017-09-21 12:43:35 -07:00
Tobias Schneider 2b102d3c56 Bug 1399605 - [intersection-observer] Check if target is actually being observed when unobserving. r=mrbkap
--HG--
extra : rebase_source : d3c8c012dba2941b230cdfbf332ab3c77b7a26ef
2017-09-19 10:50:10 -07:00
Milan Sreckovic 8ad3e52a49 Bug 1387514: Upgrade BaseRect (derived classes) width and height direct member variable use to instead use Width()/SetWidth() and Height()/SetHeight() in dom/*. r=overholt
MozReview-Commit-ID: B9YWmM3C1oX

--HG--
extra : rebase_source : d7c27de968295ee13ece8bda23798cb215d60a4b
2017-08-14 08:30:10 -04:00
Brad Werth d073eb9bda Bug 1383296 Part 1: Remove all uses of the nsCSSValue::Serialization enum, now that it no longer has multiple values. r=heycam
MozReview-Commit-ID: n6px5hNHtB

--HG--
extra : rebase_source : 6269a9d52e0282d0391276dc1b9ee26dbde7b985
2017-07-21 17:26:35 -07:00
Tobias Schneider 44b1781d8a Bug 1366371 - Use signed integer for intersection threshold. r=mstange
--HG--
extra : rebase_source : 9ac9144cd74e74b084c284b0e848b3a7dbbe575a
2017-07-26 16:00:58 -07:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Tobias Schneider b411281ed7 Bug 1359311 - (intersection-observer) Send update notifications in same order as observed. r=smaug
--HG--
extra : rebase_source : 36dc59e18178204e01d293db177664ca994d5117
2017-06-25 19:35:21 -07:00
Tobias Schneider 73616729d7 Bug 1363650 - (intersection-observer) Use content area as the intersection rectangle for custom root with overflow clip. r=mattwoodrow
--HG--
extra : rebase_source : f5f559903d704159a062d99fa43360a6222a3ee7
2017-06-21 10:40:44 -07:00
Phil Ringnalda 4b3c78827c Backed out changeset eeb0a65afa6d (bug 1363650) for wpt failures in intersection-observer/bounding-box.html and intersection-observer/unclipped-root.html
MozReview-Commit-ID: HycwX8lA9sw
2017-06-20 20:50:08 -07:00
Tobias Schneider cfab4c8f59 Bug 1363650 - (intersection-observer) Use content area as the intersection rectangle for custom root with overflow clip. r=mattwoodrow
--HG--
extra : rebase_source : 28c2af53622e02a2e46f49cd0aed642522d86937
2017-06-20 16:43:17 -07:00
Tobias Schneider e5f0ccbf64 Bug 1359317 - (intersection-observer) Use targetFrame->GetRectRelativeToSelf() as the initial intersection rect. r=mstange 2017-06-19 13:32:07 -07:00
Mats Palmgren 4264d9480f Bug 1371925 - Remove unnecessary hashtable lookups in DOMIntersectionObserver. r=froydnj
MozReview-Commit-ID: LUt03nCz3SD
2017-06-17 00:06:04 +02:00
Tobias Schneider b002e63faf Bug 1370968 - Guard against possible NULL values when IntersecionObserver API is used in XUL pages. r=mstange
--HG--
extra : rebase_source : e4e7adb0113b39cda607bf9f863e75165ed402c1
2017-06-07 15:16:59 -07:00
Tobias Schneider f47b467c52 Bug 1359318 - (intersection-observer) Map intersectionRect to the coordinate space of the target document. r=mstange 2017-06-02 14:11:31 -07:00
Tobias Schneider 5e2804200d Bug 1359316 - (intersection-observer) Intersection ratio should be 1.0 for zero-area intersections. r=mstange 2017-05-17 12:19:07 -07:00
Tobias Schneider 35d8cb5c30 Bug 1358668 - (intersection-observer) Set rootBounds to an empty rectangle instead of null when not intersecting. r=mstange 2017-05-24 17:12:31 -07:00
Emilio Cobos Álvarez e44543aad4 Bug 1360241: Devirtualize nsIFrame::GetType. r=heycam
MozReview-Commit-ID: 5Nzhyta5Hle

--HG--
extra : rebase_source : c2e9d4bfb9239f5e851d110cd7dff98c1e1a8d8b
2017-04-30 17:30:08 +02:00
Tobias Schneider fa547be7bd Bug 1353529 - Crash when using IntersectionObserver in XUL pages. r=mstange
MozReview-Commit-ID: 9RBrnst4Wkb

--HG--
extra : rebase_source : 257874993e1a1fa81931b2c513357c92b6f705a9
2017-04-04 20:14:46 -07:00
Tobias Schneider b7b6c5f6b1 Bug 1319137 - (intersection-observer) Add isIntersecting property to IntersectionObserverEntry r=mrbkap,mstange
MozReview-Commit-ID: GmwpD0FYWAa

--HG--
extra : rebase_source : b87bff385f10ee97d491548d98557e0e2cd2ad21
2017-02-08 11:22:53 -08:00
Tobias Schneider 5167bc2af8 Bug 1337936 - (intersection-observer) Revise lifetime management. r=smaug
MozReview-Commit-ID: 4pzm00igBLR

--HG--
extra : rebase_source : ad9c5581f991c392f431793fde289b8ca8245bd0
2017-02-22 10:45:13 -08:00
Sebastian Hengst ae051c91a0 Backed out changeset 5f93d62d9229 (bug 1337936) for asserting in crashtest 869038.html. r=backout 2017-02-22 14:06:26 +01:00
Tobias Schneider 0da735fe74 Bug 1337936 - (intersection-observer) Revise lifetime management. r=smaug
MozReview-Commit-ID: AvdDJaRELXm

--HG--
extra : rebase_source : a3e8705822545fd4c1cee688939c617a419d3936
2017-02-21 03:13:39 -08:00
Tobias Schneider 93adeed0fe Bug 1333580 - Properly unregister last unobserved target. r=mrbkap
MozReview-Commit-ID: FfPJFSXeT98

--HG--
extra : rebase_source : d902715f419a4e3e1249d4e1d424953cbe8931e3
2017-01-24 14:11:34 -08:00
Olli Pettay 0364dbc792 Bug 1326507, remove NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS, r=mccr8
--HG--
extra : rebase_source : 3ae1207308de120b7299b13ecaa95dd1612b3459
2017-01-03 21:47:55 +02:00
Tobias Schneider 7702c68f7a Bug 1324209 - Safely iterate over mIntersectionObservers in nsDocument::NotifyIntersectionObservers. r=mstange
MozReview-Commit-ID: DmtTUiCObHM
2016-12-21 11:36:41 -08:00
Tobias Schneider eef5af1c91 Bug 1322717 - Disconnect/Unlink in the proper order to avoid crashes in mozilla::dom::DOMIntersectionObserver::UnlinkTarget. r=mrbkap 2016-12-08 18:54:07 -08:00