本文整理汇总了C++中JSCSSStyleDeclaration::impl方法的典型用法代码示例。如果您正苦于以下问题:C++ JSCSSStyleDeclaration::impl方法的具体用法?C++ JSCSSStyleDeclaration::impl怎么用?C++ JSCSSStyleDeclaration::impl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSCSSStyleDeclaration
的用法示例。
在下文中一共展示了JSCSSStyleDeclaration::impl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nameGetter
// FIXME: You can get these properties, and set them (see customPut below),
// but you should also be able to enumerate them.
JSValue JSCSSStyleDeclaration::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
JSCSSStyleDeclaration* thisObj = static_cast<JSCSSStyleDeclaration*>(asObject(slot.slotBase()));
// Set up pixelOrPos boolean to handle the fact that
// pixelTop returns "CSS Top" as number value in unit pixels
// posTop returns "CSS top" as number value in unit pixels _if_ its a
// positioned element. if it is not a positioned element, return 0
// from MSIE documentation FIXME: IMPLEMENT THAT (Dirk)
bool pixelOrPos;
String prop = cssPropertyName(propertyName, &pixelOrPos);
RefPtr<CSSValue> v = thisObj->impl()->getPropertyCSSValue(prop);
if (v) {
if (pixelOrPos && v->cssValueType() == CSSValue::CSS_PRIMITIVE_VALUE)
return jsNumber(exec, static_pointer_cast<CSSPrimitiveValue>(v)->getFloatValue(CSSPrimitiveValue::CSS_PX));
return jsStringOrNull(exec, v->cssText());
}
// If the property is a shorthand property (such as "padding"),
// it can only be accessed using getPropertyValue.
// Make the SVG 'filter' attribute undetectable, to avoid confusion with the IE 'filter' attribute.
if (propertyName == "filter")
return StringObjectThatMasqueradesAsUndefined::create(exec, thisObj->impl()->getPropertyValue(prop));
return jsString(exec, thisObj->impl()->getPropertyValue(prop));
}
示例2: getOwnPropertyNames
void JSCSSStyleDeclaration::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
JSCSSStyleDeclaration* thisObject = jsCast<JSCSSStyleDeclaration*>(object);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
unsigned length = thisObject->impl()->length();
for (unsigned i = 0; i < length; ++i)
propertyNames.add(Identifier::from(exec, i));
static Identifier* propertyIdentifiers = 0;
if (!propertyIdentifiers) {
Vector<String, numCSSProperties> jsPropertyNames;
for (int id = firstCSSProperty; id < firstCSSProperty + numCSSProperties; ++id)
jsPropertyNames.append(getJSPropertyName(static_cast<CSSPropertyID>(id)));
sort(jsPropertyNames.begin(), jsPropertyNames.end(), WTF::codePointCompareLessThan);
propertyIdentifiers = new Identifier[numCSSProperties];
for (int i = 0; i < numCSSProperties; ++i)
propertyIdentifiers[i] = Identifier(exec, jsPropertyNames[i].impl());
}
for (int i = 0; i < numCSSProperties; ++i)
propertyNames.add(propertyIdentifiers[i]);
Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
}
示例3: jsCSSStyleDeclarationParentRule
JSValue jsCSSStyleDeclarationParentRule(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(slotBase));
UNUSED_PARAM(exec);
CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->parentRule()));
return result;
}
示例4: isReachableFromOpaqueRoots
bool JSCSSStyleDeclarationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
JSCSSStyleDeclaration* jsCSSStyleDeclaration = static_cast<JSCSSStyleDeclaration*>(handle.get().asCell());
if (!isObservable(jsCSSStyleDeclaration))
return false;
void* root = WebCore::root(jsCSSStyleDeclaration->impl());
return visitor.containsOpaqueRoot(root);
}
示例5: jsCSSStyleDeclarationCssText
JSValue jsCSSStyleDeclarationCssText(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(slotBase));
UNUSED_PARAM(exec);
CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
JSValue result = jsStringOrNull(exec, imp->cssText());
return result;
}
示例6: jsCSSStyleDeclarationLength
JSValue jsCSSStyleDeclarationLength(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(slotBase));
UNUSED_PARAM(exec);
CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
JSValue result = jsNumber(imp->length());
return result;
}
示例7: setJSCSSStyleDeclarationCssText
void setJSCSSStyleDeclarationCssText(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(thisObject);
CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
ExceptionCode ec = 0;
imp->setCssText(valueToStringWithNullCheck(exec, value), ec);
setDOMException(exec, ec);
}
示例8: visitChildren
void JSCSSStyleDeclaration::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSCSSStyleDeclaration* thisObject = jsCast<JSCSSStyleDeclaration*>(cell);
ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
Base::visitChildren(thisObject, visitor);
visitor.addOpaqueRoot(root(thisObject->impl()));
}
示例9: nameGetter
JSValue JSCSSStyleDeclaration::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
JSCSSStyleDeclaration* thisObj = static_cast<JSCSSStyleDeclaration*>(asObject(slotBase));
// Set up pixelOrPos boolean to handle the fact that
// pixelTop returns "CSS Top" as number value in unit pixels
// posTop returns "CSS top" as number value in unit pixels _if_ its a
// positioned element. if it is not a positioned element, return 0
// from MSIE documentation FIXME: IMPLEMENT THAT (Dirk)
bool pixelOrPos;
String prop = cssPropertyName(propertyName, &pixelOrPos);
RefPtr<CSSValue> v = thisObj->impl()->getPropertyCSSValue(prop);
if (v) {
if (pixelOrPos && v->isPrimitiveValue())
return jsNumber(static_pointer_cast<CSSPrimitiveValue>(v)->getFloatValue(CSSPrimitiveValue::CSS_PX));
return jsStringOrNull(exec, v->cssText());
}
// If the property is a shorthand property (such as "padding"),
// it can only be accessed using getPropertyValue.
return jsString(exec, thisObj->impl()->getPropertyValue(prop));
}
示例10: jsCSSStyleDeclarationPrototypeFunctionItem
EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionItem(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
return throwVMTypeError(exec);
JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
unsigned index(exec->argument(0).toUInt32(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
JSC::JSValue result = jsString(exec, imp->item(index));
return JSValue::encode(result);
}
示例11: jsCSSStyleDeclarationPrototypeFunctionIsPropertyImplicit
EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionIsPropertyImplicit(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
return throwVMTypeError(exec);
JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
const String& propertyName(ustringToString(exec->argument(0).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
JSC::JSValue result = jsBoolean(imp->isPropertyImplicit(propertyName));
return JSValue::encode(result);
}
示例12: jsCSSStyleDeclarationPrototypeFunctionGetPropertyShorthand
EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionGetPropertyShorthand(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
return throwVMTypeError(exec);
JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSCSSStyleDeclaration::s_info);
CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
const String& propertyName(ustringToString(exec->argument(0).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
JSC::JSValue result = jsStringOrNull(exec, imp->getPropertyShorthand(propertyName));
return JSValue::encode(result);
}
示例13: jsCSSStyleDeclarationPrototypeFunctionSetProperty
EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionSetProperty(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
return throwVMTypeError(exec);
JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
ExceptionCode ec = 0;
const String& propertyName(ustringToString(exec->argument(0).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
const String& value(valueToStringWithNullCheck(exec, exec->argument(1)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
const String& priority(ustringToString(exec->argument(2).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
imp->setProperty(propertyName, value, priority, ec);
setDOMException(exec, ec);
return JSValue::encode(jsUndefined());
}
示例14: finalize
void JSCSSStyleDeclarationOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
JSCSSStyleDeclaration* jsCSSStyleDeclaration = static_cast<JSCSSStyleDeclaration*>(handle.get().asCell());
DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
uncacheWrapper(world, jsCSSStyleDeclaration->impl(), jsCSSStyleDeclaration);
}
示例15: indexGetter
JSValue JSCSSStyleDeclaration::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
{
JSCSSStyleDeclaration* thisObj = static_cast<JSCSSStyleDeclaration*>(asObject(slotBase));
ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);
return jsStringOrNull(exec, thisObj->impl()->item(index));
}