зеркало из https://github.com/mozilla/gecko-dev.git
merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: qyo4rHNUlV
This commit is contained in:
Коммит
a6560aed66
|
@ -1912,8 +1912,8 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
|
|||
|
||||
ClearInDocument();
|
||||
|
||||
// Computed styled data isn't useful for detached nodes, and we'll need to
|
||||
// recomputed it anyway if we ever insert the nodes back into a document.
|
||||
// Computed style data isn't useful for detached nodes, and we'll need to
|
||||
// recompute it anyway if we ever insert the nodes back into a document.
|
||||
if (IsStyledByServo()) {
|
||||
ClearServoData();
|
||||
} else {
|
||||
|
|
|
@ -23,6 +23,7 @@ class HTMLButtonElement final : public nsGenericHTMLFormElementWithState,
|
|||
{
|
||||
public:
|
||||
using nsIConstraintValidation::GetValidationMessage;
|
||||
using nsGenericHTMLFormElementWithState::GetFormAction;
|
||||
|
||||
explicit HTMLButtonElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
|
||||
FromParser aFromParser = NOT_FROM_PARSER);
|
||||
|
|
|
@ -1585,6 +1585,27 @@ HTMLFormElement::FlushPendingSubmission()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
HTMLFormElement::GetAction(nsString& aValue)
|
||||
{
|
||||
if (!GetAttr(kNameSpaceID_None, nsGkAtoms::action, aValue) ||
|
||||
aValue.IsEmpty()) {
|
||||
nsIDocument* document = OwnerDoc();
|
||||
nsIURI* docURI = document->GetDocumentURI();
|
||||
if (docURI) {
|
||||
nsAutoCString spec;
|
||||
nsresult rv = docURI->GetSpec(spec);
|
||||
if (NS_FAILED(rv)) {
|
||||
return;
|
||||
}
|
||||
|
||||
CopyUTF8toUTF16(spec, aValue);
|
||||
}
|
||||
} else {
|
||||
GetURIAttr(nsGkAtoms::action, nullptr, aValue);
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLFormElement::GetActionURL(nsIURI** aActionURL,
|
||||
nsIContent* aOriginatingElement)
|
||||
|
|
|
@ -314,7 +314,8 @@ public:
|
|||
SetHTMLAttr(nsGkAtoms::acceptcharset, aValue, aRv);
|
||||
}
|
||||
|
||||
// XPCOM GetAction() is OK
|
||||
void GetAction(nsString& aValue);
|
||||
|
||||
void SetAction(const nsAString& aValue, ErrorResult& aRv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::action, aValue, aRv);
|
||||
|
|
|
@ -137,6 +137,7 @@ class HTMLInputElement final : public nsGenericHTMLFormElementWithState,
|
|||
public:
|
||||
using nsIConstraintValidation::GetValidationMessage;
|
||||
using nsGenericHTMLFormElementWithState::GetForm;
|
||||
using nsGenericHTMLFormElementWithState::GetFormAction;
|
||||
|
||||
enum class FromClone { no, yes };
|
||||
|
||||
|
|
|
@ -2428,6 +2428,32 @@ nsGenericHTMLFormElement::IsLabelable() const
|
|||
type == NS_FORM_TEXTAREA;
|
||||
}
|
||||
|
||||
void
|
||||
nsGenericHTMLFormElement::GetFormAction(nsString& aValue)
|
||||
{
|
||||
uint32_t type = ControlType();
|
||||
if (!(type & NS_FORM_INPUT_ELEMENT) && !(type & NS_FORM_BUTTON_ELEMENT)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetAttr(kNameSpaceID_None, nsGkAtoms::formaction, aValue) ||
|
||||
aValue.IsEmpty()) {
|
||||
nsIDocument* document = OwnerDoc();
|
||||
nsIURI* docURI = document->GetDocumentURI();
|
||||
if (docURI) {
|
||||
nsAutoCString spec;
|
||||
nsresult rv = docURI->GetSpec(spec);
|
||||
if (NS_FAILED(rv)) {
|
||||
return;
|
||||
}
|
||||
|
||||
CopyUTF8toUTF16(spec, aValue);
|
||||
}
|
||||
} else {
|
||||
GetURIAttr(nsGkAtoms::formaction, nullptr, aValue);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void
|
||||
|
|
|
@ -1120,6 +1120,8 @@ public:
|
|||
|
||||
virtual bool IsLabelable() const override;
|
||||
|
||||
void GetFormAction(nsString& aValue);
|
||||
|
||||
protected:
|
||||
virtual ~nsGenericHTMLFormElement();
|
||||
|
||||
|
|
|
@ -27,8 +27,11 @@ reflectBoolean({
|
|||
attribute: "disabled",
|
||||
});
|
||||
|
||||
// TODO: formAction (URL). But note that we currently reflect it weirdly; see
|
||||
// dom/html/test/test_bug607145.html
|
||||
// .formAction
|
||||
reflectURL({
|
||||
element: document.createElement("button"),
|
||||
attribute: "formAction",
|
||||
});
|
||||
|
||||
// .formEnctype
|
||||
reflectLimitedEnumerated({
|
||||
|
|
|
@ -22,8 +22,10 @@ reflectString({
|
|||
otherValues: [ "ISO-8859-1", "UTF-8" ],
|
||||
});
|
||||
|
||||
// TODO: action (URL). But note that we currently reflect it weirdly; see
|
||||
// dom/html/test/test_bug607145.html
|
||||
reflectURL({
|
||||
element: document.createElement("form"),
|
||||
attribute: "action",
|
||||
});
|
||||
|
||||
// .autocomplete
|
||||
reflectLimitedEnumerated({
|
||||
|
|
|
@ -97,8 +97,12 @@ reflectBoolean({
|
|||
|
||||
// TODO: form (HTMLFormElement)
|
||||
// TODO: files (FileList)
|
||||
// TODO: formAction (URL). But note that we currently reflect it weirdly; see
|
||||
// dom/html/test/test_bug607145.html
|
||||
|
||||
// .formAction
|
||||
reflectURL({
|
||||
element: document.createElement("button"),
|
||||
attribute: "formAction",
|
||||
});
|
||||
|
||||
// .formEnctype
|
||||
reflectLimitedEnumerated({
|
||||
|
|
|
@ -31,16 +31,17 @@ function reflectURL(aElement, aAttr)
|
|||
var attr = aAttr.toLowerCase();
|
||||
var elmtName = aElement.tagName.toLowerCase();
|
||||
|
||||
var previousDir = location.href.replace(/test\/[^\/]*$/, "");
|
||||
var dir = location.href.replace(/test_bug607145.html[^\/]*$/, "");
|
||||
var doc = location.href.replace(/\.html.*/, ".html");
|
||||
|
||||
ok(idl in aElement, idl + " should be available in " + elmtName);
|
||||
|
||||
// Default values.
|
||||
is(aElement[idl], "", "." + idl + " default value should be the empty string");
|
||||
is(aElement[idl], doc, "." + idl + " default value should be the document's URL");
|
||||
is(aElement.getAttribute(attr), null,
|
||||
"@" + attr + " default value should be null");
|
||||
|
||||
var previousDir = location.href.replace(/test\/[^\/]*$/, "");
|
||||
var dir = location.href.replace(/test_bug607145.html[^\/]*$/, "");
|
||||
var doc = location.href.replace(/\.html.*/, ".html")
|
||||
var values = [
|
||||
/* value to set, resolved value */
|
||||
[ "foo.html", dir + "foo.html" ],
|
||||
|
@ -49,7 +50,7 @@ function reflectURL(aElement, aAttr)
|
|||
[ "//example.org/", "http://example.org/" ],
|
||||
[ "?foo=bar", doc + "?foo=bar" ],
|
||||
[ "#foo", location.href + "#foo" ],
|
||||
[ "", "" ], // TODO: doesn't follow the specs, should be location.href.
|
||||
[ "", doc ],
|
||||
[ " ", location.href ],
|
||||
[ "../", previousDir ],
|
||||
[ "...", dir + "..." ],
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
#include "mozilla/layers/CompositorOGL.h"
|
||||
#include "mozilla/layers/TextureHostOGL.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "MacIOSurfaceHelpers.h"
|
||||
|
||||
class MacIOSurface;
|
||||
|
||||
|
@ -44,7 +46,8 @@ public:
|
|||
|
||||
virtual already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override
|
||||
{
|
||||
return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING)
|
||||
RefPtr<gfx::SourceSurface> surf = CreateSourceSurfaceFromMacIOSurface(GetMacIOSurface());
|
||||
return surf->GetDataSurface();
|
||||
}
|
||||
|
||||
gl::GLContext* gl() const;
|
||||
|
|
|
@ -56,6 +56,11 @@ bool is_glcontext_egl(void* glcontext_ptr)
|
|||
return glcontext->GetContextType() == mozilla::gl::GLContextType::EGL;
|
||||
}
|
||||
|
||||
bool gfx_use_wrench()
|
||||
{
|
||||
return gfxEnv::EnableWebRenderRecording();
|
||||
}
|
||||
|
||||
void gfx_critical_note(const char* msg)
|
||||
{
|
||||
gfxCriticalNote << msg;
|
||||
|
@ -574,15 +579,17 @@ WebRenderBridgeParent::ProcessWebRenderParentCommands(InfallibleTArray<WebRender
|
|||
NS_ERROR("CompositableHost does not exist");
|
||||
break;
|
||||
}
|
||||
TextureHost* texture = host->GetAsTextureHostForComposite();
|
||||
if (!texture) {
|
||||
NS_ERROR("TextureHost does not exist");
|
||||
break;
|
||||
}
|
||||
WebRenderTextureHost* wrTexture = texture->AsWebRenderTextureHost();
|
||||
if (wrTexture) {
|
||||
wrTexture->AddWRImage(mApi, keys, wrTexture->GetExternalImageKey());
|
||||
break;
|
||||
if (!gfxEnv::EnableWebRenderRecording()) {
|
||||
TextureHost* texture = host->GetAsTextureHostForComposite();
|
||||
if (!texture) {
|
||||
NS_ERROR("TextureHost does not exist");
|
||||
break;
|
||||
}
|
||||
WebRenderTextureHost* wrTexture = texture->AsWebRenderTextureHost();
|
||||
if (wrTexture) {
|
||||
wrTexture->AddWRImage(mApi, keys, wrTexture->GetExternalImageKey());
|
||||
break;
|
||||
}
|
||||
}
|
||||
RefPtr<DataSourceSurface> dSurf = host->GetAsSurface();
|
||||
if (!dSurf) {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "WebRenderCompositableHolder.h"
|
||||
|
||||
#include "CompositableHost.h"
|
||||
#include "gfxEnv.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/layers/WebRenderImageHost.h"
|
||||
#include "mozilla/layers/WebRenderTextureHost.h"
|
||||
|
@ -161,7 +162,7 @@ WebRenderCompositableHolder::GetImageKeyForTextureHost(wr::WebRenderAPI* aApi, T
|
|||
|
||||
WebRenderTextureHost* wrTexture = aTexture->AsWebRenderTextureHost();
|
||||
|
||||
if (wrTexture) {
|
||||
if (!gfxEnv::EnableWebRenderRecording() && wrTexture) {
|
||||
wrTexture->GetWRImageKeys(aKeys, std::bind(&WebRenderCompositableHolder::GetImageKey, this));
|
||||
MOZ_ASSERT(!aKeys.IsEmpty());
|
||||
Range<const wr::ImageKey> keys(&aKeys[0], aKeys.Length());
|
||||
|
|
|
@ -34,6 +34,9 @@ public:
|
|||
// Debugging inside of ContainerLayerComposite
|
||||
DECL_GFX_ENV("DUMP_DEBUG", DumpDebug);
|
||||
|
||||
// Use WR recording
|
||||
DECL_GFX_ENV("ENABLE_WR_RENDERING", EnableWebRenderRecording);
|
||||
|
||||
// OpenGL shader debugging in OGLShaderProgram, in DEBUG only
|
||||
DECL_GFX_ENV("MOZ_DEBUG_SHADERS", DebugShaders);
|
||||
|
||||
|
|
|
@ -19,13 +19,6 @@ use rayon;
|
|||
|
||||
extern crate webrender_api;
|
||||
|
||||
// Enables binary recording that can be used with `wrench replay`
|
||||
// Outputs a wr-record-*.bin file for each window that is shown
|
||||
// Note: wrench will panic if external images are used, they can
|
||||
// be disabled in WebRenderBridgeParent::ProcessWebRenderCommands
|
||||
// by commenting out the path that adds an external image ID
|
||||
static ENABLE_RECORDING: bool = false;
|
||||
|
||||
type WrAPI = RenderApi;
|
||||
type WrBorderStyle = BorderStyle;
|
||||
type WrBoxShadowClipMode = BoxShadowClipMode;
|
||||
|
@ -661,6 +654,12 @@ extern "C" {
|
|||
fn is_in_render_thread() -> bool;
|
||||
fn is_in_main_thread() -> bool;
|
||||
fn is_glcontext_egl(glcontext_ptr: *mut c_void) -> bool;
|
||||
// Enables binary recording that can be used with `wrench replay`
|
||||
// Outputs a wr-record-*.bin file for each window that is shown
|
||||
// Note: wrench will panic if external images are used, they can
|
||||
// be disabled in WebRenderBridgeParent::ProcessWebRenderCommands
|
||||
// by commenting out the path that adds an external image ID
|
||||
fn gfx_use_wrench() -> bool;
|
||||
fn gfx_critical_note(msg: *const c_char);
|
||||
}
|
||||
|
||||
|
@ -834,7 +833,7 @@ pub extern "C" fn wr_window_new(window_id: WrWindowId,
|
|||
-> bool {
|
||||
assert!(unsafe { is_in_render_thread() });
|
||||
|
||||
let recorder: Option<Box<ApiRecordingReceiver>> = if ENABLE_RECORDING {
|
||||
let recorder: Option<Box<ApiRecordingReceiver>> = if unsafe { gfx_use_wrench() } {
|
||||
let name = format!("wr-record-{}.bin", window_id.0);
|
||||
Some(Box::new(BinaryRecorder::new(&PathBuf::from(name))))
|
||||
} else {
|
||||
|
|
|
@ -20,6 +20,7 @@ bool is_in_compositor_thread();
|
|||
bool is_in_main_thread();
|
||||
bool is_in_render_thread();
|
||||
bool is_glcontext_egl(void* glcontext_ptr);
|
||||
bool gfx_use_wrench();
|
||||
void gfx_critical_note(const char* msg);
|
||||
void* get_proc_address_from_glcontext(void* glcontext_ptr, const char* procname);
|
||||
|
||||
|
|
|
@ -4047,9 +4047,11 @@ BaselineCompiler::emit_JSOP_TOID()
|
|||
frame.syncStack(0);
|
||||
masm.loadValue(frame.addressOfStackValue(frame.peek(-1)), R0);
|
||||
|
||||
// No-op if index is int32.
|
||||
// No-op if the index is trivally convertable to an id.
|
||||
Label done;
|
||||
masm.branchTestInt32(Assembler::Equal, R0, &done);
|
||||
masm.branchTestString(Assembler::Equal, R0, &done);
|
||||
masm.branchTestSymbol(Assembler::Equal, R0, &done);
|
||||
|
||||
prepareVMCall();
|
||||
|
||||
|
|
|
@ -12477,8 +12477,9 @@ IonBuilder::jsop_toasynciter()
|
|||
AbortReasonOr<Ok>
|
||||
IonBuilder::jsop_toid()
|
||||
{
|
||||
// No-op if the index is an integer.
|
||||
if (current->peek(-1)->type() == MIRType::Int32)
|
||||
// No-op if the index is trivally convertable to an id.
|
||||
MIRType type = current->peek(-1)->type();
|
||||
if (type == MIRType::Int32 || type == MIRType::String || type == MIRType::Symbol)
|
||||
return Ok();
|
||||
|
||||
MDefinition* index = current->pop();
|
||||
|
|
|
@ -189,7 +189,7 @@ IonGetPropertyIC::update(JSContext* cx, HandleScript outerScript, IonGetProperty
|
|||
|
||||
/* static */ bool
|
||||
IonSetPropertyIC::update(JSContext* cx, HandleScript outerScript, IonSetPropertyIC* ic,
|
||||
HandleObject obj, HandleValue idVal, HandleValue rhs)
|
||||
HandleObject obj, HandleValue idVal, HandleValue rhs)
|
||||
{
|
||||
RootedShape oldShape(cx);
|
||||
RootedObjectGroup oldGroup(cx);
|
||||
|
@ -226,7 +226,10 @@ IonSetPropertyIC::update(JSContext* cx, HandleScript outerScript, IonSetProperty
|
|||
|
||||
jsbytecode* pc = ic->pc();
|
||||
if (ic->kind() == CacheKind::SetElem) {
|
||||
if (IsPropertyInitOp(JSOp(*pc))) {
|
||||
if (*pc == JSOP_INITELEM_INC) {
|
||||
if (!InitArrayElemOperation(cx, pc, obj, idVal.toInt32(), rhs))
|
||||
return false;
|
||||
} else if (IsPropertyInitOp(JSOp(*pc))) {
|
||||
if (!InitElemOperation(cx, pc, obj, idVal, rhs))
|
||||
return false;
|
||||
} else {
|
||||
|
@ -241,7 +244,12 @@ IonSetPropertyIC::update(JSContext* cx, HandleScript outerScript, IonSetProperty
|
|||
RootedScript script(cx, ic->script());
|
||||
MOZ_ASSERT(!script->hasNonSyntacticScope());
|
||||
InitGlobalLexicalOperation(cx, &cx->global()->lexicalEnvironment(), script, pc, rhs);
|
||||
} else if (IsPropertyInitOp(JSOp(*pc))) {
|
||||
RootedId id(cx, AtomToId(&idVal.toString()->asAtom()));
|
||||
if (!InitPropertyOperation(cx, JSOp(*pc), obj, id, rhs))
|
||||
return false;
|
||||
} else {
|
||||
MOZ_ASSERT(IsPropertySetOp(JSOp(*pc)));
|
||||
RootedPropertyName name(cx, idVal.toString()->asAtom().asPropertyName());
|
||||
if (!SetProperty(cx, obj, name, rhs, ic->strict(), pc))
|
||||
return false;
|
||||
|
|
|
@ -649,7 +649,7 @@ InitElemOperation(JSContext* cx, jsbytecode* pc, HandleObject obj, HandleValue i
|
|||
if (!ToPropertyKey(cx, idval, &id))
|
||||
return false;
|
||||
|
||||
unsigned flags = JSOp(*pc) == JSOP_INITHIDDENELEM ? 0 : JSPROP_ENUMERATE;
|
||||
unsigned flags = GetInitDataPropAttrs(JSOp(*pc));
|
||||
return DefineProperty(cx, obj, id, val, nullptr, nullptr, flags);
|
||||
}
|
||||
|
||||
|
|
|
@ -4761,10 +4761,12 @@ js::GetInitDataPropAttrs(JSOp op)
|
|||
{
|
||||
switch (op) {
|
||||
case JSOP_INITPROP:
|
||||
case JSOP_INITELEM:
|
||||
return JSPROP_ENUMERATE;
|
||||
case JSOP_INITLOCKEDPROP:
|
||||
return JSPROP_PERMANENT | JSPROP_READONLY;
|
||||
case JSOP_INITHIDDENPROP:
|
||||
case JSOP_INITHIDDENELEM:
|
||||
// Non-enumerable, but writable and configurable
|
||||
return 0;
|
||||
default:;
|
||||
|
|
|
@ -5795,14 +5795,15 @@ pref("fuzzing.enabled", false);
|
|||
#if defined(XP_WIN)
|
||||
#if defined(NIGHTLY_BUILD)
|
||||
pref("layers.mlgpu.dev-enabled", true);
|
||||
#else
|
||||
pref("layers.mlgpu.dev-enabled", false);
|
||||
#endif
|
||||
|
||||
// Both this and the master "enabled" pref must be on to use Advanced Layers
|
||||
// on Windows 7.
|
||||
pref("layers.mlgpu.enable-on-windows7", true);
|
||||
#else
|
||||
pref("layers.mlgpu.dev-enabled", false);
|
||||
pref("layers.mlgpu.enable-on-windows7", false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Set advanced layers preferences here to have them show up in about:config or
|
||||
// to be overridable in reftest.list files. They should pretty much all be set
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
[formAction_document_address.html]
|
||||
type: testharness
|
||||
[Check if button.formAction is the document's address when formaction content attribute is missing]
|
||||
expected: FAIL
|
||||
|
||||
[Check if input.formAction is the document's address when formaction content attribute is missing]
|
||||
expected: FAIL
|
||||
|
||||
[Check if button.formAction is the document's address when formaction content attribute value is empty string]
|
||||
expected: FAIL
|
||||
|
||||
[Check if input.formAction is the document's address when formaction content attribute value is empty string]
|
||||
expected: FAIL
|
||||
|
||||
[Check if button.formAction is the document's address when formaction content attribute value is not assigned]
|
||||
expected: FAIL
|
||||
|
||||
[Check if input.formAction is the document's address when formaction content attribute value is not assigned]
|
||||
expected: FAIL
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[formaction.html]
|
||||
type: testharness
|
||||
[On getting, when formaction is missing, the document's address must be returned]
|
||||
expected: FAIL
|
||||
|
||||
[On getting, when formaction value is the empty string, the document's address must be returned]
|
||||
expected: FAIL
|
||||
|
|
@ -69,6 +69,25 @@
|
|||
var address = document.location.href;
|
||||
assert_equals(formAction, address);
|
||||
}, "Check if input.formAction is the document's address when formaction content attribute value is not assigned");
|
||||
|
||||
var newUrl = location.href.replace(/\/[^\/]*$/,'\/dummy.html');
|
||||
history.pushState('','','dummy.html');
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.location.href, newUrl);
|
||||
|
||||
var formAction = document.querySelector('#missing button').formAction;
|
||||
var address = document.location.href;
|
||||
assert_equals(formAction, address);
|
||||
}, "Check if button.formAction is the document's new address when formaction content attribute is missing and pushState has been used");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.location.href, newUrl);
|
||||
|
||||
var formAction = document.querySelector('#missing input').formAction;
|
||||
var address = document.location.href;
|
||||
assert_equals(formAction, address);
|
||||
}, "Check if input.formAction is the document's new address when formaction content attribute is missing and pushState has been used");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Загрузка…
Ссылка в новой задаче