mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
817a8eed36
- Bug 1248105 - Move CSSPseudoElement::GetParentObject out of header, r=boris (b851c3806d) - Bug 1248581 - Fix build bustage on WakeLock.h and CSSPseudoElement.h. r=khuey (fb47a96889) - Bug 1249230 - Prepend an extra colon to the pseudo type string. r=birtles (6af63f00de) - fix build on Mac > 10.5 (1ae9402eaf) - Bug 1241118 - Add gc = GetGeneralCategory(ch) when sc == MOZ_SCRIPT_COMMON. r=jfkthame (51dfbede47) - minor crash rep (1e7e5bc97e) - Bug 1240904 - Remove ParamTraits for NPString and NPVariant. r=bsmedberg (1850d10374) - bug 1170584 - fix PluginMessageUtils on iOS. r=jimm (c624cbe92d) - Bug 1170343 - Use release-mode asserts when plugins making NPAPI calls on the wrong thread, r=mccr8 (15c71250f4) - Bug 1239525 - Make sure async plugin initialization is off if e10s is on. r=aklotz (07e73ce74d) - Bug 1128454 - When plugin bridging fails, propagate the error back to the content process without aborting tabs. r=billm (e1547c00ab) - Bug 1222169 - remove unused function from PluginProcessChild.cpp; r=aklotz (11a8fc32e1) - Bug 1239749 - Remove extra space from PermissionSettings.js debug message. r=gwagner (abe2ac7574) - Bug 1221104 - Revoke 'midi' permission queries with TypeError. r=baku (cce673498f) - Bug 1221104 - Throw NS_ERROR_NOT_IMPLEMENTED instead of NS_ERROR_UNEXPECTED for PushPermissionDescriptor.userVisible. r=baku (face32ed7b) - Bug 1228723 - Avoid a promise worker proxy deadlock caused by synchronous Push callbacks. r=catalinb (bd564a0483) - Bug 1191931, Part 1 - Use tasks in the Push subscription tests. r=mt (3109fdf2af) - Bug 1191931, Part 2 - Test resubscribing from a worker. r=m (9527fa2672) - Bug 1243781 - Push methods called from a worker should reject with a `DOMException`. r=mt (f66818b161) - Bug 1219064 - Add test for extendable pushsubscriptionchange event. r=mt (12af4b59dd) - Bug 1176449 - Enter an update here to avoid assertions on startup. r=dbaron (1109cce81d) - Bug 1239743: Do not allow windows to be resized to sizes above the maximum texture size. We don't know how to draw to these anyway. r=jimm (694dafd544) - Remove some static_casting in CompositorParent. (bug 1245765 part 5, r=mattwoodrow) (4c7f39b18e) - Bug 1133615 - Don't assert about the contents of RestyleData::mDescendants when in a full style rebuild. r=dbaron (2b071b90d2) - Bug 1237902 (part 1) - Remove unneeded gfxContext ops in DrawTableBorderSegment(). r=roc. (8490ab67ca) - Bug 1237902 (part 2) - Pass a DrawTarget to DrawTableBorderSegment(). r=roc. (c602535af0) - Bug 1237902 (part 3) - Change the gfxContextMatrixAutoSaveRestore in PaintTableBorderBackground() to an AutoRestoreTransform. r=roc. (0b2412e7d6) - Bug 1242164 - Remove the implementation of colspan=0 (which is now dead code). r=dbaron (88555a04a4) - Bug 1235478 - Part 1: Rename eAdjustingTimer to eForceAdjustTimer. r=mchang (113a98fa28) - Bug 1235478 - Part 2: Don't update mMostRecentRefresh when nsRefreshDriver::ScheduleViewManagerFlush is called. r=mchang (7fd8599b7b) - Bug 1235478 - Part 3: Make weightmapping-12579.html fuzzy on MacOS 10.10. r=jdaggett (559683f95d) - Bug 1234049 - Ensure we always invalidate new PresShells that are created for an inactive DocShell upon reactivating them. r=smaug (aeca3e08d9) - Re-backout c216ff19d690 (bug 1059014 part 3) because the removed code is less dead than it first appears. (2cce434c50)
117 lines
3.4 KiB
C++
117 lines
3.4 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "mozilla/dom/CSSPseudoElement.h"
|
|
#include "mozilla/dom/CSSPseudoElementBinding.h"
|
|
#include "mozilla/dom/Element.h"
|
|
|
|
namespace mozilla {
|
|
namespace dom {
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CSSPseudoElement, mParentElement)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(CSSPseudoElement, AddRef)
|
|
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(CSSPseudoElement, Release)
|
|
|
|
CSSPseudoElement::CSSPseudoElement(Element* aElement,
|
|
CSSPseudoElementType aType)
|
|
: mParentElement(aElement)
|
|
, mPseudoType(aType)
|
|
{
|
|
MOZ_ASSERT(aElement);
|
|
MOZ_ASSERT(aType == CSSPseudoElementType::after ||
|
|
aType == CSSPseudoElementType::before,
|
|
"Unexpected Pseudo Type");
|
|
}
|
|
|
|
CSSPseudoElement::~CSSPseudoElement()
|
|
{
|
|
// Element might have been unlinked already, so we have to do null check.
|
|
if (mParentElement) {
|
|
mParentElement->DeleteProperty(
|
|
GetCSSPseudoElementPropertyAtom(mPseudoType));
|
|
}
|
|
}
|
|
|
|
ParentObject
|
|
CSSPseudoElement::GetParentObject() const
|
|
{
|
|
return mParentElement->GetParentObject();
|
|
}
|
|
|
|
JSObject*
|
|
CSSPseudoElement::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|
{
|
|
return CSSPseudoElementBinding::Wrap(aCx, this, aGivenProto);
|
|
}
|
|
|
|
void
|
|
CSSPseudoElement::GetAnimations(nsTArray<RefPtr<Animation>>& aRetVal)
|
|
{
|
|
// Bug 1234403: Implement this API.
|
|
NS_NOTREACHED("CSSPseudoElement::GetAnimations() is not implemented yet.");
|
|
}
|
|
|
|
already_AddRefed<Animation>
|
|
CSSPseudoElement::Animate(
|
|
JSContext* aContext,
|
|
JS::Handle<JSObject*> aFrames,
|
|
const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
|
|
ErrorResult& aError)
|
|
{
|
|
// Bug 1241784: Implement this API.
|
|
NS_NOTREACHED("CSSPseudoElement::Animate() is not implemented yet.");
|
|
return nullptr;
|
|
}
|
|
|
|
/* static */ already_AddRefed<CSSPseudoElement>
|
|
CSSPseudoElement::GetCSSPseudoElement(Element* aElement,
|
|
CSSPseudoElementType aType)
|
|
{
|
|
if (!aElement) {
|
|
return nullptr;
|
|
}
|
|
|
|
nsIAtom* propName = CSSPseudoElement::GetCSSPseudoElementPropertyAtom(aType);
|
|
RefPtr<CSSPseudoElement> pseudo =
|
|
static_cast<CSSPseudoElement*>(aElement->GetProperty(propName));
|
|
if (pseudo) {
|
|
return pseudo.forget();
|
|
}
|
|
|
|
// CSSPseudoElement is a purely external interface created on-demand, and
|
|
// when all references from script to the pseudo are dropped, we can drop the
|
|
// CSSPseudoElement object, so use a non-owning reference from Element to
|
|
// CSSPseudoElement.
|
|
pseudo = new CSSPseudoElement(aElement, aType);
|
|
nsresult rv = aElement->SetProperty(propName, pseudo, nullptr, true);
|
|
if (NS_FAILED(rv)) {
|
|
NS_WARNING("SetProperty failed");
|
|
return nullptr;
|
|
}
|
|
return pseudo.forget();
|
|
}
|
|
|
|
/* static */ nsIAtom*
|
|
CSSPseudoElement::GetCSSPseudoElementPropertyAtom(CSSPseudoElementType aType)
|
|
{
|
|
switch (aType) {
|
|
case CSSPseudoElementType::before:
|
|
return nsGkAtoms::cssPseudoElementBeforeProperty;
|
|
|
|
case CSSPseudoElementType::after:
|
|
return nsGkAtoms::cssPseudoElementAfterProperty;
|
|
|
|
default:
|
|
NS_NOTREACHED("Should not try to get CSSPseudoElement "
|
|
"other than ::before or ::after");
|
|
return nullptr;
|
|
}
|
|
}
|
|
|
|
} // namespace dom
|
|
} // namespace mozilla
|