Commit Graph

1100 Commits

Author SHA1 Message Date
Sylvestre Ledru
36a1079e0f Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D58175
2020-01-09 21:50:11 +00:00
Emilio Cobos Álvarez
aab1464a8a Bug 1605803 - Use cbindgen for content property. r=xidorn
This cleans up and also allows us to keep the distinction between content: none
and content: normal, which allows us to fix the computed style we return from
getComputedStyle().

Do this last bit from the resolved value instead of StyleAdjuster, because
otherwise we need to tweak every initial struct for ::before / ::after.

Differential Revision: https://phabricator.services.mozilla.com/D58276
2020-01-05 13:10:39 +00:00
Alex Henrie
502856a780 Bug 1604393 - Remove dead assignment from nsImageFrame::DisplayAltFeedbackWithoutLayer. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D57417
2019-12-18 19:51:13 +00:00
Emilio Cobos Álvarez
0ba9abf4dd Bug 1602047 - For <img src=""> (no current request), do not use mapped aspect ratio. r=tnikkel
This works in chrome because they don't event create an image box for this case,
which is totally against the spec.

The spec doesn't consider an image with a null image request, but our behavior
changes in some other places as well because of it...

Depends on D56367

Differential Revision: https://phabricator.services.mozilla.com/D56368
2019-12-10 05:28:15 +00:00
Emilio Cobos Álvarez
77a365c22a Bug 1602047 - Cleanup nsImageFrame::UpdateIntrinsic{Size,Ratio}. r=tnikkel
We always pass mImage.

Differential Revision: https://phabricator.services.mozilla.com/D56367
2019-12-10 05:26:06 +00:00
Gabriele Svelto
eeb9bfc398 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
2019-12-06 09:16:44 +00:00
Edgar Chen
aa4ce717b2 Bug 1580491 - Use Element::HasNonEmptyAttr in various places; r=bzbarsky
This was done by reviewing the results of
https://searchfox.org/mozilla-central/search?q=%2F*GetAttr%5C(.%2B(%26%26%7C%5C%7C%5C%7C)&case=true&regexp=true
one by one and replacing them with Element::HasNonEmptyAttr if possible.

Differential Revision: https://phabricator.services.mozilla.com/D51241
2019-11-01 15:24:25 +00:00
Ting-Yu Lin
b488f5928e Bug 1591546 Part 2 - Add WritingMode::IsPhysicalRTL(). r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D50772
2019-10-28 18:22:05 +00:00
Ting-Yu Lin
b5326b49c4 Bug 1587645 Part 2 - Add WritingMode::IsPhysicalLTR(). r=jfkthame
I discovered this while improving `ScrollFrameHelper::IsPhysicalLTR()`
in Part 1. Our code base needs a notion of physical direction. Let's add
it to WritingMode.

Differential Revision: https://phabricator.services.mozilla.com/D49818
2019-10-25 20:01:46 +00:00
Emilio Cobos Álvarez
a92681e720 Bug 1590426 - Cleanup signatures in nsImageFrame / nsImageControlFrame. r=tnikkel
In particular, remove useless virtual keywords per our style guide, and remove
redundant argument names (argument names where the name is contained in the type
of the argument), since they're somewhat useless.

I think the result looks neater.

Differential Revision: https://phabricator.services.mozilla.com/D50074
2019-10-22 19:05:21 +00:00
Emilio Cobos Álvarez
6ee0301143 Bug 1589955 - Sync-decode images when intrinsic ratio between the old and new source changes. r=tnikkel
This seems to fix it for me, and it's pretty straight-forward, but I _think_
we'd still paint the old image if the image is huge and it's loading, which
may be counter-productive. Maybe we should guard the whole "paint mOldImage"
with and if (!oldImageIsDifferent), wdyt?

Differential Revision: https://phabricator.services.mozilla.com/D50062
2019-10-23 12:22:06 +00:00
Emilio Cobos Álvarez
096b38a57d Bug 1590191 - Trigger image loads for <area> cursor styles. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D49998
2019-10-23 08:29:54 +00:00
Andrew Osmond
985dac6203 Bug 1574493 - Part 3. Stop rounding rects/clips during display list building. r=jrmuizel
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.

Differential Revision: https://phabricator.services.mozilla.com/D45058
2019-09-14 16:17:04 +00:00
Ciure Andrei
c5f80130da Backed out 6 changesets (bug 1574493) for causing nested-sticky-2.html to perma fail CLOSED TREE
Backed out changeset 358746636448 (bug 1574493)
Backed out changeset 34aef5498237 (bug 1574493)
Backed out changeset 1f88e2031c76 (bug 1574493)
Backed out changeset 07c588b5ea10 (bug 1574493)
Backed out changeset 0685e8d3510e (bug 1574493)
Backed out changeset 15d4390220c4 (bug 1574493)
2019-09-13 19:26:50 +03:00
Andrew Osmond
56529c6d35 Bug 1574493 - Part 3. Stop rounding rects/clips during display list building. r=jrmuizel
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.

Differential Revision: https://phabricator.services.mozilla.com/D45058
2019-09-13 14:03:23 +00:00
Ciure Andrei
604db60afa Backed out 6 changesets (bug 1574493) for causing nested-sticky-1.html to perma fail CLOSED TREE
Backed out changeset fdc25a90b0ef (bug 1574493)
Backed out changeset 0ce3c48c1f79 (bug 1574493)
Backed out changeset 326b9f96614b (bug 1574493)
Backed out changeset b0817c0aee77 (bug 1574493)
Backed out changeset 70d99c264df9 (bug 1574493)
Backed out changeset e5217ab4b668 (bug 1574493)
2019-09-13 16:17:47 +03:00
Andrew Osmond
b46396996b Bug 1574493 - Part 3. Stop rounding rects/clips during display list building. r=jrmuizel
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.

Differential Revision: https://phabricator.services.mozilla.com/D45058
2019-09-13 10:48:31 +00:00
Gurzau Raul
286937ae26 Backed out 6 changesets (bug 1574493) for wrench failures at stacking-context-clip.yaml on a CLOSED TREE.
Backed out changeset 8a8736ac4e25 (bug 1574493)
Backed out changeset 4a3294e88823 (bug 1574493)
Backed out changeset 0c26ecdc1ddc (bug 1574493)
Backed out changeset 11257f7b3ad3 (bug 1574493)
Backed out changeset dcedc286ad9d (bug 1574493)
Backed out changeset 87f216e0753d (bug 1574493)
2019-09-12 18:34:07 +03:00
Andrew Osmond
407ca7b579 Bug 1574493 - Part 3. Stop rounding rects/clips during display list building. r=jrmuizel
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.

Differential Revision: https://phabricator.services.mozilla.com/D45058
2019-09-12 12:42:41 +00:00
Timothy Nikkel
997680a097 Bug 1578158. Make sure the presshell is for an active tab before asking to decode an image. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D44355
2019-09-03 13:48:47 +00:00
kriswright
b2abfbf59c Bug 1573268 - Convert layout.animated-image-layers.enabled to static pref. r=njn
Converts layout.animated-image-layers.enabled to a static pref and removes the nsLayoutUtils::AnimatedImageLayersEnabled() function, replacing it with the static pref.

Differential Revision: https://phabricator.services.mozilla.com/D41652
2019-08-13 00:03:38 +00:00
Thomas Nguyen
a5728563c2 Bug 1566411 Use ReferrerInfo class in imgLoader.idl r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D38177
2019-07-25 08:23:32 +00:00
Sylvestre Ledru
3bf4f867df Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D38057
2019-07-16 07:33:44 +00:00
Boris Zbarsky
ed4f8b7e51 Bug 1565767 part 5. Remove some unnecesary refcounting at nsIContent::GetBaseURI callsites. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D37973
2019-07-15 18:29:05 +00:00
Boris Zbarsky
942187fe9e Bug 1565688. Remove unused IOService arg from NS_NewURI. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D37968
2019-07-15 13:39:51 +00:00
Emilio Cobos Álvarez
8cc302644d Bug 1565690 - When inferring an aspect ratio from an image's width and height attribute, only honor it if we don't have the real image aspect-ratio. r=dholbert
Since people like to get wrong attribute values on their images (see the
regressions from bug 1547231).

Differential Revision: https://phabricator.services.mozilla.com/D37936
2019-07-12 21:47:49 +00:00
Emilio Cobos Álvarez
2113328e15 Bug 1218456 - Allow navigating when there's no pres context. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37404
2019-07-09 23:07:29 +02:00
Dorel Luca
7a5944a08d Backed out 5 changesets (bug 1218456) for Crashtest failures on dom/l10n/tests/mochitest/dom_localization/test_overlay.html. CLOSED TREE
Backed out changeset 31afe89c2d42 (bug 1218456)
Backed out changeset 8bd57ebc4528 (bug 1218456)
Backed out changeset e5d37afff36a (bug 1218456)
Backed out changeset e3da86278ecf (bug 1218456)
Backed out changeset 343046089f8e (bug 1218456)
2019-07-09 22:04:13 +03:00
Emilio Cobos Álvarez
851bb098fd Bug 1218456 - Allow navigating when there's no pres context. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37404
2019-07-09 16:17:27 +00:00
Emilio Cobos Álvarez
3244910d0e Bug 1561738 - Remove nsStyleCoord. r=boris
And move the useful bits of it somewhere else (ServoStyleConstInlines.h for the
inline function definitions, and nsFrame.cpp for the static assertions).

Differential Revision: https://phabricator.services.mozilla.com/D36120
2019-06-28 12:44:44 +02:00
Cosmin Sabou
a5a1cf97a8 Backed out 3 changesets (bug 1561738) for causing build bustages on nsGridContainerFrame.cpp CLOSED TREE
Backed out changeset 98f100abc2ba (bug 1561738)
Backed out changeset 9ed20d0fb9ba (bug 1561738)
Backed out changeset 483b1e134ace (bug 1561738)
2019-06-28 13:27:09 +03:00
Emilio Cobos Álvarez
a622c42ad4 Bug 1561738 - Remove nsStyleCoord. r=boris
And move the useful bits of it somewhere else (ServoStyleConstInlines.h for the
inline function definitions, and nsFrame.cpp for the static assertions).

Differential Revision: https://phabricator.services.mozilla.com/D36120
2019-06-28 09:46:26 +00:00
Emilio Cobos Álvarez
8509cee753 Bug 1547231 - Make mapped aspect-ratio get reflected in images. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D29039
2019-06-26 22:10:08 +00:00
Daniel Holbert
b50a97ee1e Bug 1551185 followup: Give nsImageFrame.cpp an #include for HTMLEditor (a type it uses in this bug's main patch). (no review, just a trivial #include addition for correctness)
This change doesn't affect behavior, but is probably needed to build
successfully in a non-unified-build configuration.
2019-06-13 10:57:04 -07:00
Will Hawkins
3863f47448 Bug 1550437: Make sure that About dialog animates the throbber. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D34429
2019-06-11 14:19:43 +00:00
Emilio Cobos Álvarez
596d38471b Bug 1554716 - Remove nsStyleColor moving the color property to nsStyleText. r=jfkthame
I think this is a good change regardless of other discussion in bug 1552587. If
we decide to move `mColor` to the top-level of the struct that can be done
separately.

Differential Revision: https://phabricator.services.mozilla.com/D32726
2019-05-31 14:48:22 +00:00
Emilio Cobos Álvarez
7f1fe59077 Bug 1554755 - Don't set nsIFrame::mMayHaveRoundedCorners to false when there are non-zero percent borders, as we don't track all sizes that are passed to this function. r=mattwoodrow
I _think_ most of the sizes that get here are going to be equivalent to
mRect.Size(), but that seems really hard to prove.

Differential Revision: https://phabricator.services.mozilla.com/D32754
2019-05-30 00:10:55 +00:00
Emilio Cobos Álvarez
b9462c094f Bug 1554664 - Work-around broken border-radius caching. r=mattwoodrow
This is just a super-low-risk work-around for bug 1554755 that we can uplift to
beta, I'll follow-up in a bit in there with a fix and a test.

The reason my patch breaks this is because my patch stopped making images
reframe.

The reframe was of course a very expensive way of invalidating that bit ;)

Differential Revision: https://phabricator.services.mozilla.com/D32749
2019-05-27 22:43:32 +00:00
Masayuki Nakano
db80d85be8 Bug 1551185 - Make nsImageFrame::ShouldDisplaySelection() check whether resizer target element is its content or not r=smaug
Currently, `nsISelectionDisplay::DISPLAY_ALL` is used only by `HTMLEditor`.
And only when it's set, `nsImageFrame::ShouldDisplaySelection()` returns `false`
if only its `mContent` is selected.  However, this is based on an assumption,
that is, when only one `<img>` is selected in an HTML editor, it's target of
resizers.  However, this is completely wrong.  Web apps can disable resizers
with `document.execCommand("enableObjectResizing", false, false)` and now,
it's disabled by default.

Therefore, this patch makes the method check whether its `mContent` is
target of resizers at the moment.

Differential Revision: https://phabricator.services.mozilla.com/D32449
2019-05-24 12:02:34 +00:00
Miko Mynttinen
ca3f9970ff Bug 1529698 - Part 1: Make LayerState enum class r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D30837
2019-05-18 20:11:11 +00:00
Miko Mynttinen
5be1561bbc Bug 1549751 - Part 2: Add nsPaintedDisplayItem r=mattwoodrow
Move ApplyOpacity(), CanApplyOpacity(), Paint() and PaintWithClip() methods to nsPaintedDisplayItem

Differential Revision: https://phabricator.services.mozilla.com/D30225
2019-05-08 13:49:56 +00:00
Emilio Cobos Álvarez
a98663d5e4 Bug 1547792 - AspectRatio should be a single ratio, not a size. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D29244
2019-05-02 23:28:21 +00:00
Masayuki Nakano
70415b08f2 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
2019-04-30 01:52:53 +00:00
Masayuki Nakano
bfa7af4826 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
2019-04-30 00:26:57 +00:00
Sylvestre Ledru
fbb733807d Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D28948
2019-04-28 09:30:05 +00:00
Ting-Yu Lin
0fd3a44146 Bug 1547261 - Fix a typo in GetIntrinsicImageSize(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29077
2019-04-27 09:07:44 +00:00
Daniel Holbert
fd16e26ae1 Bug 1544121: Make size-contained replaced elements behave as if they had 0x0 intrinsic size and ratio. r=TYLin
Spec quote from https://drafts.csswg.org/css-contain/#containment-size :
"Replaced elements must be treated as having an intrinsic width and height of 0"

To achieve that, we just need to:
 (a) make all of these frame classes' GetPrefISize and GetMinISize methods return 0 if they're styled with contain:size.
 (b) make all of these frame classes' GetIntrinsicSize() and GetIntrinsicRatio() methods return 0,0.

In some cases, these methods are implemented in terms of common helper methods
(and sometimes member variables). For those cases, this patch adjusts the
helper methods (and variables) rather than the getters themselves.

Also: in one case (nsHTMLCanvasFrame), I needed to update its ComputeSize
method to remove a dependency on the "real" intrinsic size & ratio. I believe
the other classes' ComputeSize implementations do the right thing automatically
by sharing code & data with their intrinsic-size codepaths.

Differential Revision: https://phabricator.services.mozilla.com/D28159
2019-04-26 00:18:32 +00:00
Emilio Cobos Álvarez
8ba05939c2 Bug 1546697 - Use a consistent style for enum classes in layout. r=dholbert
Per the discussion in:

  https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ

They should be CamelCase, and that's what most of them already do. This converts
the rest, which are a few.

For the ones that already used `e` or `k` prefixes, I've mostly done:

 for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done

For the ones that used uppercase, I've removed the prefix if it was already in
the type name, and turn them into CamelCase.

Depends on D28680

Differential Revision: https://phabricator.services.mozilla.com/D28681
2019-04-25 23:03:04 +00:00
Emilio Cobos Álvarez
e89dbf7c4d Bug 1547138 - IntrinsicSize shouldn't use nsStyleCoord. r=dholbert
We have a better type to represent "a coord or nothing", and that's Maybe.

This code is shorter, and I think reads generally better / is less easy to
misuse.

I wrote this on top of bug 1547126 so there shouldn't be conflicts.

Differential Revision: https://phabricator.services.mozilla.com/D28921
2019-04-25 23:48:14 +00:00
Masayuki Nakano
12b5544904 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
2019-04-25 05:04:15 +00:00