Commit Graph

342 Commits

Author SHA1 Message Date
Alex Vincent
3cb405965c Bug 1626015 - Implement ParentNode#ReplaceChildren. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D75891
2020-05-28 00:58:24 +00:00
Razvan Maries
f8a2bcc110 Backed out changeset 004abcb3322e (bug 1626015) for perma failures on idlharness.window.html. CLOSED TREE 2020-05-28 01:23:57 +03:00
Alexander J. Vincent
e9ee229d54 Bug 1626015 - Implement ParentNode#ReplaceChildren. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D75891
2020-05-27 18:44:13 +00:00
Emilio Cobos Álvarez
89958b377a Bug 1640605 - Remove IsInAnonymousSubtree / IsRootOfAnonymousSubtree. r=edgar
In favor of the NativeAnonymous versions which they forward to.

Done automatically with:

  rg -l 'IsInAnonymousSubtree' | xargs sed -i 's/IsInAnonymousSubtree/IsInNativeAnonymousSubtree/g'

And removing the function definitions afterwards.

Differential Revision: https://phabricator.services.mozilla.com/D76681
2020-05-25 11:43:51 +00:00
Emilio Cobos Álvarez
c3b7227771 Bug 1639392 - Merge nsIStyleSheetLinkingElement and nsStyleLinkElement, and call it LinkStyle. r=jwatt
Which is the spec term. nsIStyleSheetLinkingElement is even more
confusing since it may not be an element at all (see: processing
instructions).

Differential Revision: https://phabricator.services.mozilla.com/D76071
2020-05-21 03:07:16 +00:00
Olli Pettay
9a394a854e Bug 1637712 - Consider to move *Ancestor* API to nsINode r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D75169
2020-05-20 14:55:15 +00:00
Mirko Brodesser
8c66344a6d Bug 1623858: part 1) Rename nsINode::IsSelectionDescendant to nsINode::IsMaybeSelected. r=smaug
More accurate.

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

--HG--
extra : moz-landing-system : lando
2020-03-20 14:27:39 +00:00
Sean Feng
33c417a9d0 Bug 1377999 - Set nsINode to use the customized new operator r=smaug
We customized the new operator to allow Dom Arena to be hooked
in.

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

--HG--
extra : moz-landing-system : lando
2020-03-17 14:52:47 +00:00
Sean Feng
ea28092183 Bug 1377999 - Handle cross docGroup node adoption by keeping arena alive r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D66662

--HG--
extra : moz-landing-system : lando
2020-03-17 14:52:45 +00:00
Boris Zbarsky
4417c6c9cc Bug 1622032. Improve some error messages in nsINode. r=nika
In particular, improve the error message for replaceChild when the two arguments get switched.

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

--HG--
extra : moz-landing-system : lando
2020-03-13 03:50:04 +00:00
Brad Werth
4c4fadb3ed Bug 1593756 Part 1: Add a new method GetBoxQuadsFromWindowOrigin. r=emilio,hiro
Window space is not a sensible space for CSS points, as returned by
getBoxQuads, since the CSS points are relative to window origin and not the
layout origin. This new method is useful in paired calling patterns, where
the returned quads are further translated by the position of the document
node relative to the window origin. Later parts of this patch demonstrate
this calling pattern in a test.

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

--HG--
extra : moz-landing-system : lando
2020-03-04 00:45:38 +00:00
Christoph Kerschbaumer
de17388af5 Bug 1374612 - CSP: Hide nonce values from the DOM. r=smaug,annevk
Differential Revision: https://phabricator.services.mozilla.com/D62811

--HG--
extra : moz-landing-system : lando
2020-02-29 12:35:46 +00:00
shindli
f5511fecc8 Backed out changeset ec4c2b2a561b (bug 1374612) for causing wpt permafails in /html/dom/reflection-metadata.html CLOSED TREE 2020-02-27 22:46:44 +02:00
Christoph Kerschbaumer
00976af48c Bug 1374612 - CSP: Hide nonce values from the DOM. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62811

--HG--
extra : moz-landing-system : lando
2020-02-27 18:08:54 +00:00
Dorel Luca
2e1e470d9e Backed out changeset 59fe98b41d80 (bug 1374612) for WPT failures in /html/dom/idlharness.https.html. CLOSED TREE
--HG--
extra : amend_source : a537237327643c365f02c0bfbed643b0d54cf1d5
2020-02-27 14:08:48 +02:00
Christoph Kerschbaumer
ec996a7e9d Bug 1374612 - CSP: Hide nonce values from the DOM. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62811

--HG--
extra : moz-landing-system : lando
2020-02-27 09:32:04 +00:00
Masayuki Nakano
1110bedb45 Bug 1613830 - Add nsINode::GetAsElementOrParentElement() r=smaug
This patch assumes that only element node can have content node.  I.e., we
won't hit the following `MOZ_ASSERT`:

```
Element* element = nullptr;
nsIContent* content = aContent;
while (content) {
  if (content->IsElement()) {
    element = content->AsElement();
    break;
  }
  content = content->GetParent();
}
MOZ_ASSERT(!content || content == element || content->GetParent() == element);
```

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

--HG--
extra : moz-landing-system : lando
2020-02-21 02:47:05 +00:00
Erik Nordin
14304c1fdf Bug 1609288 - Apply styles from adopted stylesheets r=emilio
- Ensure that adopted styles are applied correctly to ShadowRoot
- Ensure that adopted styles are applied correctly to Document
- Add new WPT test cases to ensure the ordering of the styles.

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

--HG--
extra : moz-landing-system : lando
2020-02-15 01:16:46 +00:00
Emilio Cobos Álvarez
0c5c683162 Bug 1614654 - Simplify property handling during adoption. r=smaug
We don't need to transfer all properties after adopt. Collecting all the nodes
with properties during adopt was needed because there used to be clone and adopt
user-data callbacks, see https://bugzilla.mozilla.org/show_bug.cgi?id=347524.

This ensures that NodeInfoChanged and similar callbacks can tweak node
properties, which is needed for bug 1542784.

Also simplify surrounding code. As far as I can tell we should always have
different documents if we get a NodeInfoManager object.

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

--HG--
extra : moz-landing-system : lando
2020-02-11 16:38:18 +00:00
Emilio Cobos Álvarez
69c87f6cb2 Bug 1613349 - Rename nsINode::DeleteProperty to RemoveProperty. r=smaug
And the related methods as well.

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

--HG--
extra : moz-landing-system : lando
2020-02-06 16:06:49 +00:00
Emilio Cobos Álvarez
86ca3370c2 Bug 1613349 - Rename nsINode::UnsetProperty to nsINode::TakeProperty. r=smaug
For consistency with the previous change for layout.

Depends on D61755

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

--HG--
extra : moz-landing-system : lando
2020-02-05 22:26:20 +00:00
Mirko Brodesser
2abd6d5a82 Bug 1609662: part 16) Move nsRange::IsNodeSelected to nsINode::IsSelected. r=smaug
Make it const-correct too.

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

--HG--
extra : moz-landing-system : lando
2020-01-27 09:25:00 +00:00
Mirko Brodesser
0be35ca14f Bug 1608071: part 3) Rename nsSlots::mCommonAncestorRanges to nsSlots::mClosestCommonInclusiveAncestorRanges. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D59329

--HG--
extra : moz-landing-system : lando
2020-01-13 10:29:56 +00:00
Mirko Brodesser
6ade70f373 Bug 1608071: part 1) Rename common ancestor to closest common inclusive ancestor around nsRange. r=smaug
It's more precise and enables one to reason more clearly about related
code.

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

--HG--
extra : moz-landing-system : lando
2020-01-13 10:29:31 +00:00
Gabriele Svelto
ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ 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/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca
a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto
bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ 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/D55442

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Sylvestre Ledru
8d2f0d1b1f Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-11-26 14:35:02 +00:00
Masayuki Nakano
20699e2189 Bug 1597679 - part 2: Make nsITextControlElement inherit nsGenericHTMLFormElementWithState r=smaug
Sub classes of `nsITextControlElement` are only `HTMLInputElement` and
`HTMLTextAreaElement`. And both base class is
`nsGenericHTMLFormElementWithState`.  Therefore, we can make
`nsITextControlElement` inherit `nsGenericHTMLFormElementWithState` and
make `HTMLInputElement` and `HTMLTextAreaElement` inherit
`nsITextControlElement`.  Then, we can get rid of a lot of QI between
`nsINode`/`nsIContent`/`Element` and `nsITextControlElement` (and note that
some of them in a hot path).

Additionally, this patch renames `nsITextControlElement` to
`mozilla::TextControlElement`.

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

--HG--
rename : dom/html/nsITextControlElement.h => dom/html/TextControlElement.h
extra : moz-landing-system : lando
2019-11-25 06:35:15 +00:00
Coroiu Cristina
84bf2b6d25 Backed out 3 changesets (bug 1597679) for Android debug build bustage at build/src/dom/base/nsContentAreaDragDrop.cpp
Backed out changeset 6a73b58e0db4 (bug 1597679)
Backed out changeset 90a172eff2de (bug 1597679)
Backed out changeset d4a156cf28ff (bug 1597679)

--HG--
rename : dom/html/TextControlElement.h => dom/html/nsITextControlElement.h
2019-11-24 09:02:53 +02:00
Masayuki Nakano
eea1784f2d Bug 1597679 - part 2: Make nsITextControlElement inherit nsGenericHTMLFormElementWithState r=smaug
Sub classes of `nsITextControlElement` are only `HTMLInputElement` and
`HTMLTextAreaElement`. And both base class is
`nsGenericHTMLFormElementWithState`.  Therefore, we can make
`nsITextControlElement` inherit `nsGenericHTMLFormElementWithState` and
make `HTMLInputElement` and `HTMLTextAreaElement` inherit
`nsITextControlElement`.  Then, we can get rid of a lot of QI between
`nsINode`/`nsIContent`/`Element` and `nsITextControlElement` (and note that
some of them in a hot path).

Additionally, this patch renames `nsITextControlElement` to
`mozilla::TextControlElement`.

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

--HG--
rename : dom/html/nsITextControlElement.h => dom/html/TextControlElement.h
extra : moz-landing-system : lando
2019-11-24 05:38:02 +00:00
Emilio Cobos Álvarez
ba2ffbed2e Bug 1597123 - Remove NODE_IS_ANONYMOUS_ROOT. r=smaug
We no longer have multiple kinds of anonymous subtrees, so we can get back one
node bit.

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

--HG--
extra : moz-landing-system : lando
2019-11-18 08:49:27 +00:00
Emilio Cobos Álvarez
7e683e7615 Bug 1596209 - Remove nsIContent::GetBindingParent. r=smaug
It's unused after all the previous patches.

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

--HG--
extra : moz-landing-system : lando
2019-11-15 18:19:37 +00:00
Sebastian Hengst
9ad1a69782 Backed out changeset 0478d1bf6e32 (bug 1596209) on request from emilio. CLOSED TREE
--HG--
extra : rebase_source : 3c14fff8de93d231125ec8714aae98e51fbf6aeb
extra : amend_source : 5f1791c11b41593330cc8c94bdf67e1a0cf11fb1
2019-11-15 19:11:06 +01:00
Emilio Cobos Álvarez
5b84f966ac Bug 1596209 - Remove nsIContent::GetBindingParent. r=smaug
It's unused after all the previous patches.

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

--HG--
extra : moz-landing-system : lando
2019-11-15 16:46:29 +00:00
Emilio Cobos Álvarez
c5d9f3067b Bug 1596768 - Remove GetBindingParent usage in nsIContent::FindFirstNonChromeOnlyAccessContent. r=smaug
This one is a bit subtle, but not too much.

Depends on D53193

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

--HG--
extra : moz-landing-system : lando
2019-11-15 15:41:07 +00:00
Emilio Cobos Álvarez
f36874d798 Bug 1596445 - Add some supporting code to nsINode to deal with NAC and shadow DOM separately. r=bzbarsky
We'll use these to remove GetBindingParent.

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

--HG--
extra : moz-landing-system : lando
2019-11-15 15:10:45 +00:00
Emilio Cobos Álvarez
6ed954d4c7 Bug 1596445 - Define nsINode::AsContent in nsINode.h. r=bzbarsky
We were already relying on reinterpret_cast so it seems ok and will make the
code in following patches a bit nicer.

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

--HG--
extra : moz-landing-system : lando
2019-11-15 12:49:10 +00:00
Emilio Cobos Álvarez
479f01b95d Bug 1596455 - Simplify nsIContent::IsInAnonymousSubtree. r=bzbarsky
Now that XBL is gone, the only anonymous subtrees are NAC.

I'd prefer to defer the removal of IsInAnonymousSubtree if possible, as there's
a bunch of patches coming on top of this one :)

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

--HG--
extra : moz-landing-system : lando
2019-11-14 23:09:03 +00:00
Emilio Cobos Álvarez
186586e54a Bug 1596391 - Remove NODE_MAY_BE_IN_BINDING_MNGR. r=smaug
Never set anymore.

Depends on D52993

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

--HG--
extra : moz-landing-system : lando
2019-11-14 12:54:00 +00:00
Mirko Brodesser
b2de103bf9 Bug 1593222: part 12) Rename "nsNodeUtils.*" to "MutationObservers.*". r=smaug
Depends on D51827

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

--HG--
rename : dom/base/nsNodeUtils.cpp => dom/base/MutationObservers.cpp
rename : dom/base/nsNodeUtils.h => dom/base/MutationObservers.h
extra : moz-landing-system : lando
2019-11-06 09:08:06 +00:00
Mirko Brodesser
ba0285f534 Bug 1593222: part 9) Move non-animation notification methods from nsNodeUtils to MutationObservers. r=smaug
The remaining notification methods are moved in a separate commit. The
files are renamed to `MutationObservers.*` in a follow-up commit.

Depends on D51824

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

--HG--
extra : moz-landing-system : lando
2019-11-05 21:32:53 +00:00
Mirko Brodesser
80f7994283 Bug 1593222: part 8) Move nsNodeUtils::CloneAndAdopt to nsINode. r=smaug
Depends on D51823

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

--HG--
extra : moz-landing-system : lando
2019-11-05 21:13:45 +00:00
Mirko Brodesser
941b8066a4 Bug 1593222: part 7) Move nsNodeUtils::Adopt to nsINode. r=smaug
Depends on D51821

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

--HG--
extra : moz-landing-system : lando
2019-11-05 20:53:00 +00:00
Mirko Brodesser
a1dadb0aaf Bug 1593222: part 6) Move nsINodeUtils::Clone to nsINode::Clone. r=smaug
Makes `nsNodeUtils::CloneAndAdopt` temporarily public. Will be hidden
again in a follow-up commit.

Depends on D51820

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

--HG--
extra : moz-landing-system : lando
2019-11-05 20:43:53 +00:00
Mirko Brodesser
673a4a18d6 Bug 1593222: part 4) Move nsNodeUtils::LastRelease to nsINode. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D51609

--HG--
extra : moz-landing-system : lando
2019-11-05 14:06:13 +00:00
Mirko Brodesser
47bb9d8c1a Bug 1593222: part 3) Move nsNodeUtils::GetFirstChildOfTemplateOrNode to nsINode. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D51608

--HG--
extra : moz-landing-system : lando
2019-11-05 14:06:05 +00:00
Mirko Brodesser
b845b4e662 Bug 1593222: part 1) Move nsNodeUtils::IsTemplateElement to nsINode. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D51606

--HG--
extra : moz-landing-system : lando
2019-11-05 14:05:36 +00:00
Emilio Cobos Álvarez
2ec3bb2b4f Bug 998590 - Cleanup HTMLHeadingElement, and add HTMLHeadingElement::FromNode. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D49406

--HG--
extra : moz-landing-system : lando
2019-10-16 14:25:05 +00:00
Emilio Cobos Álvarez
68daa729f5 Bug 1585823 - Make ShadowRoot use consistent DOM binding wrapping, and make nsINode::WrapObject final. r=smaug
Looks like an oversight from all the way back to bug 806506.



Depends on D48538

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

--HG--
extra : moz-landing-system : lando
2019-10-09 11:53:24 +00:00