本文整理汇总了C++中AtomicString::length方法的典型用法代码示例。如果您正苦于以下问题:C++ AtomicString::length方法的具体用法?C++ AtomicString::length怎么用?C++ AtomicString::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AtomicString
的用法示例。
在下文中一共展示了AtomicString::length方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseTransformAttribute
bool SVGTransformable::parseTransformAttribute(SVGTransformList* list, const AtomicString& transform)
{
const UChar* start = transform.characters();
const UChar* end = start + transform.length();
return parseTransformAttribute(list, start, end);
}
示例2: parseTransformAttribute
bool SVGTransformable::parseTransformAttribute(SVGTransformList* list, const AtomicString& transform)
{
double x[] = {0, 0, 0, 0, 0, 0};
int nr = 0, required = 0, optional = 0;
const UChar* currTransform = transform.characters();
const UChar* end = currTransform + transform.length();
bool delimParsed = false;
while (currTransform < end) {
delimParsed = false;
unsigned short type = SVGTransform::SVG_TRANSFORM_UNKNOWN;
skipOptionalSpaces(currTransform, end);
if (currTransform >= end)
return false;
if (*currTransform == 's') {
if (skipString(currTransform, end, skewXDesc, sizeof(skewXDesc) / sizeof(UChar))) {
required = 1;
optional = 0;
type = SVGTransform::SVG_TRANSFORM_SKEWX;
} else if (skipString(currTransform, end, skewYDesc, sizeof(skewYDesc) / sizeof(UChar))) {
required = 1;
optional = 0;
type = SVGTransform::SVG_TRANSFORM_SKEWY;
} else if (skipString(currTransform, end, scaleDesc, sizeof(scaleDesc) / sizeof(UChar))) {
required = 1;
optional = 1;
type = SVGTransform::SVG_TRANSFORM_SCALE;
} else
return false;
} else if (skipString(currTransform, end, translateDesc, sizeof(translateDesc) / sizeof(UChar))) {
required = 1;
optional = 1;
type = SVGTransform::SVG_TRANSFORM_TRANSLATE;
} else if (skipString(currTransform, end, rotateDesc, sizeof(rotateDesc) / sizeof(UChar))) {
required = 1;
optional = 2;
type = SVGTransform::SVG_TRANSFORM_ROTATE;
} else if (skipString(currTransform, end, matrixDesc, sizeof(matrixDesc) / sizeof(UChar))) {
required = 6;
optional = 0;
type = SVGTransform::SVG_TRANSFORM_MATRIX;
} else
return false;
if ((nr = parseTransformParamList(currTransform, end, x, required, optional)) < 0)
return false;
SVGTransform t;
switch (type) {
case SVGTransform::SVG_TRANSFORM_SKEWX:
t.setSkewX(narrowPrecisionToFloat(x[0]));
break;
case SVGTransform::SVG_TRANSFORM_SKEWY:
t.setSkewY(narrowPrecisionToFloat(x[0]));
break;
case SVGTransform::SVG_TRANSFORM_SCALE:
if (nr == 1) // Spec: if only one param given, assume uniform scaling
t.setScale(narrowPrecisionToFloat(x[0]), narrowPrecisionToFloat(x[0]));
else
t.setScale(narrowPrecisionToFloat(x[0]), narrowPrecisionToFloat(x[1]));
break;
case SVGTransform::SVG_TRANSFORM_TRANSLATE:
if (nr == 1) // Spec: if only one param given, assume 2nd param to be 0
t.setTranslate(narrowPrecisionToFloat(x[0]), 0);
else
t.setTranslate(narrowPrecisionToFloat(x[0]), narrowPrecisionToFloat(x[1]));
break;
case SVGTransform::SVG_TRANSFORM_ROTATE:
if (nr == 1)
t.setRotate(narrowPrecisionToFloat(x[0]), 0, 0);
else
t.setRotate(narrowPrecisionToFloat(x[0]), narrowPrecisionToFloat(x[1]), narrowPrecisionToFloat(x[2]));
break;
case SVGTransform::SVG_TRANSFORM_MATRIX:
t.setMatrix(AffineTransform(x[0], x[1], x[2], x[3], x[4], x[5]));
break;
}
ExceptionCode ec = 0;
list->appendItem(t, ec);
skipOptionalSpaces(currTransform, end);
if (currTransform < end && *currTransform == ',') {
delimParsed = true;
currTransform++;
}
skipOptionalSpaces(currTransform, end);
}
return !delimParsed;
}
示例3: showValidationMessage
void ValidationMessageClientImpl::showValidationMessage(const Element& anchor, const String& message)
{
if (message.isEmpty()) {
hideValidationMessage(anchor);
return;
}
if (!anchor.renderBox())
return;
if (m_currentAnchor)
hideValidationMessage(*m_currentAnchor);
m_currentAnchor = &anchor;
IntRect anchorInRootView = currentView()->contentsToRootView(anchor.pixelSnappedBoundingBox());
m_lastAnchorRectInScreen = currentView()->hostWindow()->rootViewToScreen(anchorInRootView);
m_lastPageScaleFactor = m_webView.pageScaleFactor();
m_message = message;
WebTextDirection dir = m_currentAnchor->renderer()->style()->direction() == RTL ? WebTextDirectionRightToLeft : WebTextDirectionLeftToRight;
AtomicString title = m_currentAnchor->fastGetAttribute(HTMLNames::titleAttr);
if (m_client)
m_client->showValidationMessage(anchorInRootView, m_message, title, dir);
m_webView.client()->showValidationMessage(anchorInRootView, m_message, title, dir);
const double minimumSecondToShowValidationMessage = 5.0;
const double secondPerCharacter = 0.05;
const double statusCheckInterval = 0.1;
m_finishTime = monotonicallyIncreasingTime() + std::max(minimumSecondToShowValidationMessage, (message.length() + title.length()) * secondPerCharacter);
// FIXME: We should invoke checkAnchorStatus actively when layout, scroll,
// or page scale change happen.
m_timer.startRepeating(statusCheckInterval);
}