Implement this new macro to reuse clone code in SVGSymbolElement in the
following patch.
MozReview-Commit-ID: 4vobWVrcbn2
--HG--
extra : rebase_source : 11e7dd9fd11199689ed5dc2a532c6517cf2e21fe
Before this patch, we were setting the dirty descendants bit in animation-only
restyles and it triggered unnecessary traversal for elements that does not need
the traversal (i.e no need selector matching).
MozReview-Commit-ID: 6pmF3ojVzgb
--HG--
extra : rebase_source : 5d83b203d4f5121c648be903165a0e9c77ca4a0c
It logically makes more sense for these effects to happen after the attribute has actually been changed and moving them allows us to get rid of the member variable HTMLImageElement::mForceReload.
MozReview-Commit-ID: IJBF3AHVb0U
--HG--
extra : rebase_source : fe3ae2a0cc55ded9702fb7654261ffee83a52057
This is necessary to facilitate the transition to cloning attributes instead of reparsing them.
HTMLImageElement's side effects proved to be a bit trickier than those of many other classes because HTMLImageElement::SetAttr intentionally forces an image reload, even if the attribute value has not been changed. Element::SetAttr, on the other hand, usually ignores attribute changes that do not change the attribute value, exiting before BeforeSetAttr is even called. In order to preserve this behavior, another virtual function |OnAttrSetButNotChanged| was added to the Element class. This function will be called in the case that Element::SetAttr exits early, allowing a forced reload to take place at that time.
MozReview-Commit-ID: 4CrH30bo5GT
--HG--
extra : rebase_source : 94245dde2710abd439671d05e99f145caca3e189
This is necessary to facilitate the transition to cloning attributes instead of reparsing them.
MozReview-Commit-ID: HzB3f1sr9y9
--HG--
extra : rebase_source : 8c343c60b5dca18fb04a4cb548907a2e4b9df1d2
Also, update an outdated comment that was leftover.
MozReview-Commit-ID: CC865rj3o3S
--HG--
extra : rebase_source : 094ed5c23a55f8f00f7aeb18856c539caa80ff86
In order to facilitate the movement of code with side-effects called by Element::SetAttr to Element::BeforeSetAttr and Element::AfterSetAttr, Element::AfterSetAttr should have access to the old value of the attribute. This includes information about whether there was previously a value set or not.
Accomplishing this involved passing an additional argument through functions that find and change the old attribute value in order to ensure that we can differentiate between an empty old value and an absent old value (attribute was not set).
Note that while I tried to ensure that accurate values (and their absence) are reported to Element::AfterSetAttr, I largely ignored SVG. While the old value reported for SVG values should be however accurate the value already being reported to SetAttrAndNotify was, SVG elements do not currently report unset values properly because they will never pass a null pointer to SetAttrAndNotify.
MozReview-Commit-ID: K1mha8CNFZP
--HG--
extra : rebase_source : 42776eb01451d371e4aebcc17fe3dd112c8d268b
A more general fast path was added in bug 1355353.
MozReview-Commit-ID: HGe9WaojoYw
--HG--
extra : rebase_source : b8d99223422a95fd764ff47042df6fe68334bb89
Currently, attribute and child arrays (implemented in dom/base/nsAttrAndChildArray.h) start out empty. When cloning, the array ends up being resized multiple times in order to add the attributes and children that are being cloned from the original node. This would be quicker if the array was initialized to the correct size in the first place so that resizes are not necessary.
However, preallocating space for children is only necessary when performing a deep clone. Therefore, an additional parameter is being added to the Clone, CopyInnerTo, and CloneDocHelper methods to indicate whether preallocation of children should happen. Attributes are copied either way, so that part of the array is preallocated in both cases.
MozReview-Commit-ID: 3iVezeAKXnI
--HG--
extra : rebase_source : 9c3deec6d7aafd6411044d623d4863637b45fd58
This patch exists to avoid a crash in layout/style/test/test_animations.html. We end up
generating some ::before content, which causes us to style the new subtree at [1]. In
StyleNewSubtree, we fail the !postTraversalRequired assertion because
PrepareAndTraverseSubtree decided to traverse the tree twice (once to style it, and again
to restyle it for animations), and return that a post-traversal is needed.
The reason this issue happens with my NAC patches and not without is that we were previously
filtering out generated ::before content from the servo traversal, so the servo traversal
wouldn't have reached it and (presumably) the animation restyle wouldn't have happened and
we wouldn't have returned true for needing a post-traversal.
[1] http://searchfox.org/mozilla-central/rev/c48398abd9f0f074c69f2223260939e30e8f99a8/layout/base/nsCSSFrameConstructor.cpp#1918
MozReview-Commit-ID: 8tgzLjV8B3A
This removes the requirement that BeforeSetAttr comes before AttributeWillChange
(which needs the preparsed new value).
MozReview-Commit-ID: 87C6Mjc7ARh
Since it's not just the EventStateManager that has access to modify
these EventStates bits.
MozReview-Commit-ID: 17EpfQT5M40
--HG--
extra : rebase_source : 6d5f7ecff2d41d66cbc23ea12e08dc6295e29875
Since it's not just the EventStateManager that has access to modify
these EventStates bits.
MozReview-Commit-ID: 17EpfQT5M40
--HG--
extra : rebase_source : 6d5f7ecff2d41d66cbc23ea12e08dc6295e29875
This fits a bit better with the other stuff, and allows us to add our new NAC
bit with the other NAC related bits, which also happens to be a field that
Servo already has easy access to.
--HG--
extra : rebase_source : 52ef902eb3b23dc44cefec899b02c9180b76160c
This fits a bit better with the other stuff, and allows us to add our new NAC
bit with the other NAC related bits, which also happens to be a field that
Servo already has easy access to.
--HG--
extra : rebase_source : 52ef902eb3b23dc44cefec899b02c9180b76160c