mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 15:17:29 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
7df6fa1c80
10 changed files with 65 additions and 44 deletions
|
|
@ -663,8 +663,8 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
|
||||||
}
|
}
|
||||||
} else if (attr.LowerCaseEqualsLiteral("referrerpolicy")) {
|
} else if (attr.LowerCaseEqualsLiteral("referrerpolicy")) {
|
||||||
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#referrer-policy-attribute
|
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#referrer-policy-attribute
|
||||||
// Specs says referrer policy attribute is an enumerated attribute,
|
// The spec says that the referrer policy attribute is an enumerated attribute,
|
||||||
// case insensitive and includes the empty string
|
// case insensitive and includes the empty string.
|
||||||
// We will parse the value with AttributeReferrerPolicyFromString
|
// We will parse the value with AttributeReferrerPolicyFromString
|
||||||
// later, which will handle parsing it as an enumerated attribute.
|
// later, which will handle parsing it as an enumerated attribute.
|
||||||
if (referrerPolicy.IsEmpty()) {
|
if (referrerPolicy.IsEmpty()) {
|
||||||
|
|
|
||||||
|
|
@ -620,8 +620,8 @@ private:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a script element, get the referrer policy should be applied to load
|
* Given a script element, get the referrer policy that should be applied to
|
||||||
* requests.
|
* load requests.
|
||||||
*/
|
*/
|
||||||
mozilla::net::ReferrerPolicy GetReferrerPolicy(nsIScriptElement* aElement);
|
mozilla::net::ReferrerPolicy GetReferrerPolicy(nsIScriptElement* aElement);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1871,8 +1871,11 @@ class JSScript : public js::gc::TenuredCell
|
||||||
}
|
}
|
||||||
|
|
||||||
js::PropertyName* getName(jsbytecode* pc) const {
|
js::PropertyName* getName(jsbytecode* pc) const {
|
||||||
MOZ_ASSERT(containsPC(pc) && containsPC(pc + sizeof(uint32_t)));
|
if (containsPC(pc) && containsPC(pc + sizeof(uint32_t))) {
|
||||||
return getAtom(GET_UINT32_INDEX(pc))->asPropertyName();
|
return getAtom(GET_UINT32_INDEX(pc))->asPropertyName();
|
||||||
|
} else {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JSObject* getObject(size_t index) {
|
JSObject* getObject(size_t index) {
|
||||||
|
|
|
||||||
|
|
@ -1960,8 +1960,13 @@ CASE(JSOP_RETRVAL)
|
||||||
|
|
||||||
/* Resume execution in the calling frame. */
|
/* Resume execution in the calling frame. */
|
||||||
if (MOZ_LIKELY(interpReturnOK)) {
|
if (MOZ_LIKELY(interpReturnOK)) {
|
||||||
TypeScript::Monitor(cx, script, REGS.pc, REGS.sp[-1]);
|
|
||||||
|
|
||||||
|
if (JSOp(*REGS.pc) == JSOP_RESUME) {
|
||||||
|
ADVANCE_AND_DISPATCH(JSOP_RESUME_LENGTH);
|
||||||
|
}
|
||||||
|
|
||||||
|
TypeScript::Monitor(cx, script, REGS.pc, REGS.sp[-1]);
|
||||||
|
MOZ_ASSERT(CodeSpec[*REGS.pc].length == JSOP_CALL_LENGTH);
|
||||||
ADVANCE_AND_DISPATCH(JSOP_CALL_LENGTH);
|
ADVANCE_AND_DISPATCH(JSOP_CALL_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2106,7 +2106,7 @@
|
||||||
* Operands: resume kind (GeneratorObject::ResumeKind)
|
* Operands: resume kind (GeneratorObject::ResumeKind)
|
||||||
* Stack: gen, val => rval
|
* Stack: gen, val => rval
|
||||||
*/ \
|
*/ \
|
||||||
macro(JSOP_RESUME, 205,"resume", NULL, 3, 2, 1, JOF_UINT8|JOF_INVOKE) \
|
macro(JSOP_RESUME, 205,"resume", NULL, 2, 2, 1, JOF_UINT16|JOF_INVOKE) \
|
||||||
/*
|
/*
|
||||||
* Pops the top two values on the stack as 'obj' and 'v', pushes 'v' to
|
* Pops the top two values on the stack as 'obj' and 'v', pushes 'v' to
|
||||||
* 'obj'.
|
* 'obj'.
|
||||||
|
|
|
||||||
|
|
@ -3335,9 +3335,7 @@ js::TypeMonitorResult(JSContext* cx, JSScript* script, jsbytecode* pc, TypeSet::
|
||||||
void
|
void
|
||||||
js::TypeMonitorResult(JSContext* cx, JSScript* script, jsbytecode* pc, const js::Value& rval)
|
js::TypeMonitorResult(JSContext* cx, JSScript* script, jsbytecode* pc, const js::Value& rval)
|
||||||
{
|
{
|
||||||
/* Allow the non-TYPESET scenario to simplify stubs used in compound opcodes. */
|
MOZ_ASSERT(CodeSpec[*pc].format & JOF_TYPESET);
|
||||||
if (!(CodeSpec[*pc].format & JOF_TYPESET))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!script->hasBaselineScript())
|
if (!script->hasBaselineScript())
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -855,8 +855,6 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
|
||||||
const nsRect& aBorderArea,
|
const nsRect& aBorderArea,
|
||||||
nsStyleContext* aStyleContext)
|
nsStyleContext* aStyleContext)
|
||||||
{
|
{
|
||||||
nscoord twipsRadii[8];
|
|
||||||
|
|
||||||
// Get our style context's color struct.
|
// Get our style context's color struct.
|
||||||
const nsStyleOutline* ourOutline = aStyleContext->StyleOutline();
|
const nsStyleOutline* ourOutline = aStyleContext->StyleOutline();
|
||||||
MOZ_ASSERT(ourOutline != NS_STYLE_BORDER_STYLE_NONE,
|
MOZ_ASSERT(ourOutline != NS_STYLE_BORDER_STYLE_NONE,
|
||||||
|
|
@ -898,24 +896,6 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
|
||||||
if (innerRect.Contains(aDirtyRect))
|
if (innerRect.Contains(aDirtyRect))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nsRect outerRect = innerRect;
|
|
||||||
outerRect.Inflate(width, width);
|
|
||||||
|
|
||||||
// get the radius for our outline
|
|
||||||
nsIFrame::ComputeBorderRadii(ourOutline->mOutlineRadius, aBorderArea.Size(),
|
|
||||||
outerRect.Size(), Sides(), twipsRadii);
|
|
||||||
|
|
||||||
// Get our conversion values
|
|
||||||
nscoord twipsPerPixel = aPresContext->DevPixelsToAppUnits(1);
|
|
||||||
|
|
||||||
// get the outer rectangles
|
|
||||||
Rect oRect(NSRectToRect(outerRect, twipsPerPixel));
|
|
||||||
|
|
||||||
// convert the radii
|
|
||||||
nsMargin outlineMargin(width, width, width, width);
|
|
||||||
RectCornerRadii outlineRadii;
|
|
||||||
ComputePixelRadii(twipsRadii, twipsPerPixel, &outlineRadii);
|
|
||||||
|
|
||||||
if (outlineStyle == NS_STYLE_BORDER_STYLE_AUTO) {
|
if (outlineStyle == NS_STYLE_BORDER_STYLE_AUTO) {
|
||||||
if (nsLayoutUtils::IsOutlineStyleAutoEnabled()) {
|
if (nsLayoutUtils::IsOutlineStyleAutoEnabled()) {
|
||||||
nsITheme* theme = aPresContext->GetTheme();
|
nsITheme* theme = aPresContext->GetTheme();
|
||||||
|
|
@ -935,6 +915,36 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
|
||||||
outlineStyle = NS_STYLE_BORDER_STYLE_SOLID;
|
outlineStyle = NS_STYLE_BORDER_STYLE_SOLID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RectCornerRadii outlineRadii;
|
||||||
|
nsRect outerRect = innerRect;
|
||||||
|
outerRect.Inflate(width, width);
|
||||||
|
|
||||||
|
const nscoord oneDevPixel = aPresContext->AppUnitsPerDevPixel();
|
||||||
|
Rect oRect(NSRectToRect(outerRect, oneDevPixel));
|
||||||
|
|
||||||
|
const Float outlineWidths[4] = {
|
||||||
|
Float(width) / oneDevPixel, Float(width) / oneDevPixel,
|
||||||
|
Float(width) / oneDevPixel, Float(width) / oneDevPixel};
|
||||||
|
|
||||||
|
// convert the radii
|
||||||
|
nscoord twipsRadii[8];
|
||||||
|
|
||||||
|
// get the radius for our outline
|
||||||
|
if (nsLayoutUtils::HasNonZeroCorner(ourOutline->mOutlineRadius)) {
|
||||||
|
nsIFrame::ComputeBorderRadii(ourOutline->mOutlineRadius, aBorderArea.Size(),
|
||||||
|
outerRect.Size(), Sides(), twipsRadii);
|
||||||
|
ComputePixelRadii(twipsRadii, oneDevPixel, &outlineRadii);
|
||||||
|
} else if (aForFrame->GetBorderRadii(twipsRadii)) {
|
||||||
|
RectCornerRadii innerRadii;
|
||||||
|
ComputePixelRadii(twipsRadii, oneDevPixel, &innerRadii);
|
||||||
|
|
||||||
|
Float devPixelOffset = aPresContext->AppUnitsToFloatDevPixels(offset);
|
||||||
|
const Float widths[4] = {
|
||||||
|
outlineWidths[0] + devPixelOffset, outlineWidths[1] + devPixelOffset,
|
||||||
|
outlineWidths[2] + devPixelOffset, outlineWidths[3] + devPixelOffset};
|
||||||
|
nsCSSBorderRenderer::ComputeOuterRadii(innerRadii, widths, &outlineRadii);
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t outlineStyles[4] = { outlineStyle, outlineStyle,
|
uint8_t outlineStyles[4] = { outlineStyle, outlineStyle,
|
||||||
outlineStyle, outlineStyle };
|
outlineStyle, outlineStyle };
|
||||||
|
|
||||||
|
|
@ -947,12 +957,7 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
|
||||||
outlineColor,
|
outlineColor,
|
||||||
outlineColor };
|
outlineColor };
|
||||||
|
|
||||||
// convert the border widths
|
Rect dirtyRect = NSRectToRect(aDirtyRect, oneDevPixel);
|
||||||
Float outlineWidths[4] = { Float(width / twipsPerPixel),
|
|
||||||
Float(width / twipsPerPixel),
|
|
||||||
Float(width / twipsPerPixel),
|
|
||||||
Float(width / twipsPerPixel) };
|
|
||||||
Rect dirtyRect = NSRectToRect(aDirtyRect, twipsPerPixel);
|
|
||||||
|
|
||||||
nsIDocument* document = nullptr;
|
nsIDocument* document = nullptr;
|
||||||
nsIContent* content = aForFrame->GetContent();
|
nsIContent* content = aForFrame->GetContent();
|
||||||
|
|
|
||||||
|
|
@ -3757,19 +3757,24 @@ nsDisplayOutline::Paint(nsDisplayListBuilder* aBuilder,
|
||||||
mFrame->StyleContext());
|
mFrame->StyleContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool nsDisplayOutline::HasRadius() const {
|
||||||
|
if (nsLayoutUtils::HasNonZeroCorner(mFrame->StyleOutline()->mOutlineRadius)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return nsLayoutUtils::HasNonZeroCorner(mFrame->StyleBorder()->mBorderRadius);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
nsDisplayOutline::IsInvisibleInRect(const nsRect& aRect)
|
nsDisplayOutline::IsInvisibleInRect(const nsRect& aRect)
|
||||||
{
|
{
|
||||||
const nsStyleOutline* outline = mFrame->StyleOutline();
|
const nsStyleOutline* outline = mFrame->StyleOutline();
|
||||||
nsRect borderBox(ToReferenceFrame(), mFrame->GetSize());
|
nsRect borderBox(ToReferenceFrame(), mFrame->GetSize());
|
||||||
if (borderBox.Contains(aRect) &&
|
if (borderBox.Contains(aRect) && !HasRadius() &&
|
||||||
!nsLayoutUtils::HasNonZeroCorner(outline->mOutlineRadius)) {
|
outline->mOutlineOffset >= 0) {
|
||||||
if (outline->mOutlineOffset >= 0) {
|
|
||||||
// aRect is entirely inside the border-rect, and the outline isn't
|
// aRect is entirely inside the border-rect, and the outline isn't
|
||||||
// rendered inside the border-rect, so the outline is not visible.
|
// rendered inside the border-rect, so the outline is not visible.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3220,6 +3220,9 @@ public:
|
||||||
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) override;
|
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) override;
|
||||||
virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) override;
|
virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) override;
|
||||||
NS_DISPLAY_DECL_NAME("Outline", TYPE_OUTLINE)
|
NS_DISPLAY_DECL_NAME("Outline", TYPE_OUTLINE)
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool HasRadius() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -510,6 +510,8 @@ nsStyleBorder::CalcDifference(const nsStyleBorder& aNewData) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note that border radius is used as a fallback for outline radius, if set.
|
||||||
|
// Any optimizations here should apply to both.
|
||||||
if (mBorderRadius != aNewData.mBorderRadius ||
|
if (mBorderRadius != aNewData.mBorderRadius ||
|
||||||
!mBorderColors != !aNewData.mBorderColors) {
|
!mBorderColors != !aNewData.mBorderColors) {
|
||||||
return nsChangeHint_RepaintFrame;
|
return nsChangeHint_RepaintFrame;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue