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

103 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez c9e3177022 Bug 1768157 - Remove kSelectPopupList. r=jwatt
It's unused since bug 1744009 at least, so no behavior change.

Depends on D145714

Differential Revision: https://phabricator.services.mozilla.com/D145715
2022-05-06 15:46:49 +00:00
Miko Mynttinen 76c9644105 Bug 1720804 - Part 1: Move majority of the display list code inside mozilla namespace r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120041
2021-07-19 11:28:20 +00:00
Ting-Yu Lin 0076add365 Bug 1641085 Part 1 - Add move semantic to nsFrameList, and use it on SetOverflowFrames(). r=mats
It's useful to use `std::move()` to indicate the frames' ownership in one list
is transferred to the another list.

For a frame list managed by AutoFrameListPtr, after moving its frames to
another list, it can be automatically deleted when it is going out of
scope.

Differential Revision: https://phabricator.services.mozilla.com/D88455
2020-08-29 00:22:16 +00:00
Simon Giesecke 8c0f977ccd Bug 1645429 - Use std::reverse_iterator instead of mozilla::ReverseIterator where possible. r=froydnj
mozilla::ReverseIterator is required for "stashing iterators", but otherwise
std::reverse_iterator can be used and is potentially more efficient.

Also fix some other glitches in iterator type definitions.

Differential Revision: https://phabricator.services.mozilla.com/D79489
2020-06-16 10:14:01 +00:00
Ting-Yu Lin 47cf315ef3 Bug 1642038 Part 3 - Minor cleanup for AutoFrameListPtr. r=mats
AutoFrameListPtr might be used more frequently after we add more APIs to
handle overflow container list and excess overflow container list in
bug 1641085.

The improvements in this patch includes:

* Mark AutoFrameListPtr as MOZ_RAII and final class.
* Move AutoFrameListPtr into mozilla namespace since we don't use layout
sub-namespace that much these days.
* Remove the AutoFrameListPtr type alias in nsGridContainerFrame's
header since it's not used.

Differential Revision: https://phabricator.services.mozilla.com/D77568
2020-06-01 23:24:52 +00:00
Cameron McCormack 0d5684a3a8 Bug 1639419 - Enable frame tree dumps whenever the layout debugger is enabled. r=TYLin,glandium
Differential Revision: https://phabricator.services.mozilla.com/D76076
2020-05-20 23:44:49 +00:00
Simon Giesecke 8aa47bcfb7 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in layout. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D66016

--HG--
extra : moz-landing-system : lando
2020-03-17 09:38:32 +00:00
Mats Palmgren ee1194b0f1 Bug 1542441 - When we pull in floats from a prev-in-flow then move any next-in-flows of those that we own to our PushedFloat list. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D27388

--HG--
extra : rebase_source : da3b54e82ae89e159ed62911715c82cb5adfe4eb
2019-04-12 23:25:47 +02:00
Masayuki Nakano f5737567dd Bug 1544343 - part 3: Make layout use mozilla::PresShell instead of nsIPresShell as far as possible r=emilio
This patch changes remaining things under `layout/`.  However, there are some
places which still need to use `nsIPresShell`.  That will be fixed in a
follow up bug.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 07:25:10 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Ting-Yu Lin 6cf6eb81f5 Bug 1515192 - Replace handcrafted FrameChildListIDs class with EnumSet. r=mats
The following APIs are changed.
1. Contains() needs to become contains(). (EnumSet's methods have lowercase names.)
2. Use list constructor rather than "|" like a plain enum.
3. Use operator+= instead of operator|=.

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

--HG--
extra : moz-landing-system : lando
2018-12-19 00:50:09 +00: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 673ea6eb31 Bug 1489139 - Ensure unbound generated content doesn't remain in the active chain. r=smaug
This reuses the same code path that was added in bug 1461299 for NAC, but for
generated content as well. DestroyAnonymousContent notifies to the ESM.

Also, remove the NativeAnonymousContentRemoved bit about <svg:use> since it's no
longer NAC.

Differential Revision: https://phabricator.services.mozilla.com/D5575
2018-09-12 16:56:40 +02:00
Ting-Yu Lin f90c2a2950 Bug 1484306 Part 4 - Use FunctionTypeTraits to yield better error message if aPredicate's signature is wrong. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D3684
2018-08-17 22:14:26 -07:00
Ting-Yu Lin 4347d6785b Bug 1484306 Part 2 - Add nsFrameList::Split(), and use it to replace the usage of FindFirstNonBlock(). r=dholbert
This API is similar to Vec::Split() in Rust.
https://doc.rust-lang.org/std/vec/struct.Vec.html#method.split

Differential Revision: https://phabricator.services.mozilla.com/D3644
2018-08-17 22:14:25 -07:00
Ting-Yu Lin f830c92c19 Bug 1484306 Part 1 - Add nsFrameList::FrameLinkEnumerator::Find(). r=dholbert
Use it to implement FindFirstBlock() and FindFirstNonBlock(). This is a
demonstration on how Find() is used. The usage of them will be overhauled in
Part 2 and 3.

Differential Revision: https://phabricator.services.mozilla.com/D3642
2018-08-17 22:14:25 -07:00
Chris Peterson 71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Emilio Cobos Álvarez 8631d601b8 Bug 1429961: Avoid copying PostDestroyData. r=mats
We don't want that to happen.

MozReview-Commit-ID: EQ6igMRyeaV

--HG--
extra : rebase_source : 58c374baf6d5d6af778829f9ca708e8aa3372899
2018-01-15 21:51:58 +01:00
Mats Palmgren 25cd0c37f7 Bug 1400618 part 1 - Collect NAC / generated content and call DestroyAnonymousContent / UnbindFromTree on those after the frames are destroyed. r=bz
MozReview-Commit-ID: 2trDgeJPw25
2017-11-07 01:20:33 +01:00
Daniel Holbert 680815cd6e Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: EuRsDue63tK

--HG--
extra : rebase_source : 3356d4b80ff6213935192e87cdbc9103fec6084c
2017-10-27 10:33:53 -07:00
Nathan Froyd d9759d258f Bug 1295192 - part 1 - remove CPP_THROW_NEW on layout struct operator new overloads that forward to nsPresShell::AllocateByObjectID; r=dholbert
Structs in our style system use an arena-style allocation system,
managed by the presshell to which they belong.  All of the relevant
overloads that forward allocation requests to the presshell declare
themselves as CPP_THROW_NEW, which indicates that they do not throw
exceptions.  The C++ specification states that operator new overloads
that declare themselves to not throw exceptions require a null check on
their return value.  However, the relevant presshell allocation method,
AllocateByObjectID, is infallible and will never return a null pointer.

The callers of all of these methods are therefore doing useless
(compiler-generated) null checks.  Let's get rid of those useless checks
by removing the CPP_THROW_NEW annotations.  This change declares these
methods will return non-null pointers and throw exceptions in case of
errors--but as we don't use exceptions, and AllocateByObjectID will
abort on OOM, everything works out OK.
2016-08-17 15:28:45 -04:00
Wes Kocher 57773cd69e Backed out 4 changesets (bug 1295192) for being a possible cause of crashtest assertions CLOSED TREE
Backed out changeset 7f10779fe019 (bug 1295192)
Backed out changeset e683dce4197a (bug 1295192)
Backed out changeset 67d12eaa8074 (bug 1295192)
Backed out changeset 44f143a01f78 (bug 1295192)
2016-08-16 11:22:04 -07:00
Nathan Froyd fa4f709cfd Bug 1295192 - part 1 - remove CPP_THROW_NEW on layout struct operator new overloads that forward to nsPresShell::AllocateByObjectID; r=dholbert
Structs in our style system use an arena-style allocation system,
managed by the presshell to which they belong.  All of the relevant
overloads that forward allocation requests to the presshell declare
themselves as CPP_THROW_NEW, which indicates that they do not throw
exceptions.  The C++ specification states that operator new overloads
that declare themselves to not throw exceptions require a null check on
their return value.  However, the relevant presshell allocation method,
AllocateByObjectID, is infallible and will never return a null pointer.

The callers of all of these methods are therefore doing useless
(compiler-generated) null checks.  Let's get rid of those useless checks
by removing the CPP_THROW_NEW annotations.  This change declares these
methods will return non-null pointers and throw exceptions in case of
errors--but as we don't use exceptions, and AllocateByObjectID will
abort on OOM, everything works out OK.
2016-08-16 17:05:39 -04:00
Ting-Yu Lin 2f7ddb73d6 Bug 1227927 Part 4 - Add comment to nsFrameList::GetLength() to warn it's O(n). r=mats
--HG--
extra : commitid : H0nct5arwsJ
extra : rebase_source : c6810483931d49f730618815642e8a582c26e35f
2016-01-29 22:42:15 +08:00
Xidorn Quan 3b95c44999 Bug 1064843 part 6 - Add backdrop frame list. r=dholbert
--HG--
extra : source : 695a16ba1cbb4e0e4f0a7e6b8ebf5c55ec62dab5
2016-01-28 10:11:00 +11:00
Birunthan Mohanathas a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Xidorn Quan 5ce6110994 Bug 1175485 part 3 - Remove unused operators, typedefs and IteratorTraits. r=waldo
--HG--
extra : source : c1d3256e987c25935cc8bd321c413a1e0c7586b3
2015-07-02 13:31:07 +10:00
Xidorn Quan f15e97fc12 Bug 1175485 part 1 - Allow inner iterator of ReverseIterator deref to any type, and change IntegerIterator, EnumeratedRange, and nsFrameList::Iterator to return value type instead of a reference. r=roc,waldo
--HG--
extra : source : 1e932a13595a1d3862f171e7e7435422d890fbf0
2015-07-02 13:31:07 +10:00
Nicholas Nethercote e6ec6218c6 Bug 1171282 - Avoid some unnecessary |operator new| null-checks in layout/. r=dholbert.
AllocateByObjectID() is infallible. Therefore the |operator new| of nsFrameList,
nsLineBox and nsRuleNode are too, as is nsRuleNode::CreateRootNode().

The patch also removes a couple of comments duplicated in both .h and .cpp
files.

--HG--
extra : rebase_source : 0b9e195fd547fdd53ddad7bb461ff5f5c2016fce
2015-06-03 23:45:11 -07:00
Xidorn Quan 2fbaf73148 Bug 1143513 - Make nsFrameList compatible with range-based syntax and utils. r=roc,waldo
--HG--
extra : source : 08caf763669386f0b5db4b5daaf4cd183380c051
2015-03-31 14:08:17 +11:00
Ehsan Akhgari 4354953b4f Bug 1118486 - Part 1: Use `= delete` instead of MOZ_DELETE directly; r=Waldo
Most of this patch (with the exception of dom/bindings/Codegen.py) was
generated by the following bash script:

#!/bin/bash

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "*/.git*" \
       ! -wholename "obj-*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_DELETE '= delete'
2015-01-08 23:19:05 -05:00
Ehsan Akhgari 2b84010cb8 Bug 1048246 - Fix more bad implicit constructors in layout; r=roc
--HG--
extra : rebase_source : ed828993139bc70232508364a9f046e38b7d3e06
2014-08-07 19:48:38 -04:00
Mats Palmgren 94d5d0fbbe Bug 508665 - part 6, Require a nsContainerFrame* for aParent in nsFrameList methods. r=roc 2014-05-24 22:20:40 +00:00
Ehsan Akhgari 2ecbad7b1c Bug 491863 - Remove IBMBIDI; r=roc 2014-04-23 21:15:29 -04:00
Kyle Huey d7764d686d Bug 981150: Use nsTArrayForwardDeclare.h more. r=ehsan 2014-03-15 12:00:17 -07:00
Timothy Nikkel 6fa728f68f Bug 978542. If paint dumping is enabled at build time also enable frame dumping so we can get frame names in display list dumps. r=mattwoodrow
Also makes DidComputeVisibility available during non-debug painting so we can use it.
2014-03-02 16:22:29 -06:00
Mats Palmgren e6ea29ce0d Bug 956447 - Make it possible to get frame dumps in non-DEBUG builds. r=roc 2014-01-05 23:31:14 +00:00
Ehsan Akhgari 290feb1ade Bug 921876 - Stop #including nsIFrame.h in nsLayoutUtils.h; r=roc
This patch does the following:
* Move nsIFrame::IntrinsicSize to mozilla::IntrinsicSize so that it can
  be forward-declared.
* Move a number of templated inline nsLayoutUtils methods to nsIFrame.
* Use mozilla::layout::FrameChildListID instead of the
  nsIFrame::ChildListID typedef in nsLayoutUtils.h.
* Move nsReflowFrameRunnable to its only user, nsProgressMeterFrame.cpp.
* Make a number of functions requiring nsIFrame.h out-of-line.
* Remove the nsIFrame.h #include from nsLayoutUtils.h and add it to the
  places which require it implicitly.
2013-09-30 17:26:04 -04:00
Ehsan Akhgari baf3a129ad Bug 907883 - Minimize #includes in layout/generic; r=roc
--HG--
extra : rebase_source : 5e87b764a12b05aff477c71547e2131be67ca93b
2013-08-22 14:32:52 -04:00
Mats Palmgren b3ddf199bb Bug 729519 - Allocate heap nsFrameLists from the shell arena. r=bzbarsky
"new nsFrameList()" becomes "new (shell) nsFrameList()".
"delete list" becomes "if (list) list->Delete(shell)" - note also that
an additional assertion was added that list is empty when deleted.

"nsAutoPtr<nsFrameList> list(StealSomeFrames())" becomes
"AutoFrameListPtr list(aPresContext, StealSomeFrames())"
2013-04-01 17:26:02 +02:00
Mats Palmgren 985f6f0f76 Bug 729519 - Allocate nsFrameList::sEmptyList from the .rodata segment, not the heap. r=bzbarsky 2013-04-01 17:26:02 +02:00
Mats Palmgren 8b24a5ee5f Bug 838706 - Remove Destroy/RemoveFrameIfPresent O(n) methods. All consumers are now using Start/ContinueRemoveFrame instead which are O(1). r=bzbarsky 2013-02-28 00:05:45 +01:00
Mats Palmgren 1b85e9545e Bug 838642 - Introduce nsFrameList::StartRemoveFrame/ContinueRemoveFrame that can be used in concert to remove a frame in O(1) time from a set of frame lists when its exact frame list is unknown. Use them to make nsContainerFrame::StealFrame O(1). r=bzbarsky 2013-02-28 00:05:44 +01:00
Ehsan Akhgari e368dc9c85 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Aryeh Gregor d0ad5a7d0c Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Gervase Markham 82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Ehsan Akhgari 92064e6d3f Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Landing on a CLOSED TREE
2011-10-17 10:59:28 -04:00
Michael Wu d2b70213ac Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
--HG--
rename : tools/trace-malloc/bloatblame.c => tools/trace-malloc/bloatblame.cpp
2011-09-28 23:19:26 -07:00
Mats Palmgren 36202edfbd Bug 653649 - New way of getting child lists from frames. (part 1/5) r=roc sr=dbaron
Add types to represent identifiers for frame child lists, sets of those
identifiers, and iterators over the child lists of a frame.
Define a enumeration type FrameChildListID representing all of the types
of child lists that frames have (each with a unique bit), a class
FrameChildListIDs for representing any set of FrameChildListID, and a
class FrameChildListIterator for iterating over all of the child lists
of a frame.
2011-08-24 22:54:29 +02:00
Craig Topper ea484247b0 Bug 654369 - Part 5: Make nsFrameList::Init return void r=bz
--HG--
extra : rebase_source : 8e9aafbc53c9b7e6be24a15707c32f19d67b7c06
2011-05-01 23:32:59 -07:00