这篇教程C++ stripLeadingAndTrailingHTMLSpaces函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中stripLeadingAndTrailingHTMLSpaces函数的典型用法代码示例。如果您正苦于以下问题:C++ stripLeadingAndTrailingHTMLSpaces函数的具体用法?C++ stripLeadingAndTrailingHTMLSpaces怎么用?C++ stripLeadingAndTrailingHTMLSpaces使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了stripLeadingAndTrailingHTMLSpaces函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: elementString SVGImageLoader::sourceURI(const AtomicString& attribute) const{ KURL base = element()->baseURI(); if (!base.isValid()) base = element()->document().baseURI(); return element()->document().completeURLWithOverride(stripLeadingAndTrailingHTMLSpaces(attribute), base);}
开发者ID:335969568,项目名称:Blink-1,代码行数:7,
示例2: formAttributeChangedvoid HTMLObjectElement::parseAttribute(const QualifiedName& name, const AtomicString& value){ if (name == formAttr) formAttributeChanged(); else if (name == typeAttr) { m_serviceType = value.lower(); size_t pos = m_serviceType.find(";"); if (pos != notFound) m_serviceType = m_serviceType.left(pos); if (renderer()) setNeedsWidgetUpdate(true); } else if (name == dataAttr) { m_url = stripLeadingAndTrailingHTMLSpaces(value); if (renderer()) { setNeedsWidgetUpdate(true); if (isImageType()) { if (!m_imageLoader) m_imageLoader = adoptPtr(new HTMLImageLoader(this)); m_imageLoader->updateFromElementIgnoringPreviousError(); } } } else if (name == classidAttr) { m_classId = value; if (renderer()) setNeedsWidgetUpdate(true); } else if (name == onbeforeloadAttr) setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value)); else HTMLPlugInImageElement::parseAttribute(name, value);}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:30,
示例3: originalDocumentbool ScriptElement::requestScript(const String& sourceUrl){ Ref<Document> originalDocument(m_element.document()); if (!m_element.dispatchBeforeLoadEvent(sourceUrl)) return false; if (!m_element.inDocument() || &m_element.document() != &originalDocument.get()) return false; ASSERT(!m_cachedScript); if (!stripLeadingAndTrailingHTMLSpaces(sourceUrl).isEmpty()) { CachedResourceRequest request(ResourceRequest(m_element.document().completeURL(sourceUrl))); String crossOriginMode = m_element.fastGetAttribute(HTMLNames::crossoriginAttr); if (!crossOriginMode.isNull()) { m_requestUsesAccessControl = true; StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials; updateRequestForAccessControl(request.mutableResourceRequest(), m_element.document().securityOrigin(), allowCredentials); } request.setCharset(scriptCharset()); request.setInitiator(&element()); m_cachedScript = m_element.document().cachedResourceLoader()->requestScript(request); m_isExternalScript = true; } if (m_cachedScript) { return true; } dispatchErrorEvent(); return false;}
开发者ID:highweb-project,项目名称:highweb-parallelwebkit,代码行数:32,
示例4: formAttributeChangedvoid HTMLObjectElement::parseAttribute(const QualifiedName& name, const AtomicString& value){ if (name == formAttr) formAttributeChanged(); else if (name == typeAttr) { m_serviceType = value.string().left(value.find(';')).lower(); setNeedsWidgetUpdate(true); } else if (name == dataAttr) { m_url = stripLeadingAndTrailingHTMLSpaces(value); setNeedsWidgetUpdate(true); document().updateStyleIfNeeded(); if (renderer()) { if (isImageType()) { if (!m_imageLoader) m_imageLoader = std::make_unique<HTMLImageLoader>(*this); m_imageLoader->updateFromElementIgnoringPreviousError(); } } } else if (name == classidAttr) setNeedsWidgetUpdate(true); else if (name == onbeforeloadAttr) setAttributeEventListener(eventNames().beforeloadEvent, name, value); else HTMLPlugInImageElement::parseAttribute(name, value);}
开发者ID:CannedFish,项目名称:webkit,代码行数:25,
示例5: LinkRelAttributevoid HTMLLinkElement::parseAttribute(Attribute* attr){ if (attr->name() == relAttr) { m_relAttribute = LinkRelAttribute(attr->value()); process(); } else if (attr->name() == hrefAttr) { String url = stripLeadingAndTrailingHTMLSpaces(attr->value()); m_url = url.isEmpty() ? KURL() : document()->completeURL(url); process(); } else if (attr->name() == typeAttr) { m_type = attr->value(); process(); } else if (attr->name() == sizesAttr) { setSizes(attr->value()); process(); } else if (attr->name() == mediaAttr) { m_media = attr->value().string().lower(); process(); } else if (attr->name() == disabledAttr) setDisabledState(!attr->isNull()); else if (attr->name() == onbeforeloadAttr) setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr));#if ENABLE(LINK_PREFETCH) else if (attr->name() == onloadAttr) setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attr)); else if (attr->name() == onerrorAttr) setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, attr));#endif else { if (attr->name() == titleAttr && m_sheet) m_sheet->setTitle(attr->value()); HTMLElement::parseAttribute(attr); }}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:34,
示例6: documentvoid HTMLAnchorElement::handleClick(Event* event){ event->setDefaultHandled(); Frame* frame = document().frame(); if (!frame) return; StringBuilder url; url.append(stripLeadingAndTrailingHTMLSpaces(fastGetAttribute(hrefAttr))); appendServerMapMousePosition(url, event); URL kurl = document().completeURL(url.toString());#if ENABLE(DOWNLOAD_ATTRIBUTE) if (hasAttribute(downloadAttr)) { ResourceRequest request(kurl); // FIXME: Why are we not calling addExtraFieldsToMainResourceRequest() if this check fails? It sets many important header fields. if (!hasRel(RelationNoReferrer)) { String referrer = SecurityPolicy::generateReferrerHeader(document().referrerPolicy(), kurl, frame->loader().outgoingReferrer()); if (!referrer.isEmpty()) request.setHTTPReferrer(referrer); frame->loader().addExtraFieldsToMainResourceRequest(request); } frame->loader().client().startDownload(request, fastGetAttribute(downloadAttr)); } else#endif frame->loader().urlSelected(kurl, target(), event, LockHistory::No, LockBackForwardList::No, hasRel(RelationNoReferrer) ? NeverSendReferrer : MaybeSendReferrer); sendPings(kurl);}
开发者ID:CannedFish,项目名称:webkit,代码行数:32,
示例7: ASSERTvoid Pasteboard::writeImage(Node* node, const KURL&, const String& title){ ASSERT(node); ASSERT(node->renderer()); ASSERT(node->renderer()->isImage()); RenderImage* renderer = toRenderImage(node->renderer()); CachedImage* cachedImage = renderer->cachedImage(); if (!cachedImage || cachedImage->errorOccurred()) return; Image* image = cachedImage->image(); ASSERT(image); NativeImagePtr bitmap = image->nativeImageForCurrentFrame(); if (!bitmap) return; // If the image is wrapped in a link, |url| points to the target of the // link. This isn't useful to us, so get the actual image URL. AtomicString urlString; if (node->hasTagName(HTMLNames::imgTag) || node->hasTagName(HTMLNames::inputTag)) urlString = static_cast<Element*>(node)->getAttribute(HTMLNames::srcAttr);#if ENABLE(SVG) else if (node->hasTagName(SVGNames::imageTag)) urlString = static_cast<Element*>(node)->getAttribute(XLinkNames::hrefAttr);#endif else if (node->hasTagName(HTMLNames::embedTag) || node->hasTagName(HTMLNames::objectTag)) { Element* element = static_cast<Element*>(node); urlString = element->getAttribute(element->imageSourceAttributeName()); } KURL url = urlString.isEmpty() ? KURL() : node->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(urlString)); ChromiumBridge::clipboardWriteImage(bitmap, url, title);}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:33,
示例8: documentvoid HTMLAnchorElement::handleClick(Event* event){ event->setDefaultHandled(); Frame* frame = document()->frame(); if (!frame) return; StringBuilder url; url.append(stripLeadingAndTrailingHTMLSpaces(fastGetAttribute(hrefAttr))); appendServerMapMousePosition(url, event); KURL kurl = document()->completeURL(url.toString());#if ENABLE(DOWNLOAD_ATTRIBUTE) if (hasAttribute(downloadAttr)) { ResourceRequest request(kurl); if (!hasRel(RelationNoReferrer)) { String referrer = SecurityPolicy::generateReferrerHeader(document()->referrerPolicy(), kurl, frame->loader()->outgoingReferrer()); if (!referrer.isEmpty()) request.setHTTPReferrer(referrer); frame->loader()->addExtraFieldsToMainResourceRequest(request); } frame->loader()->client()->startDownload(request, fastGetAttribute(downloadAttr)); } else#endif frame->loader()->urlSelected(kurl, target(), event, false, false, hasRel(RelationNoReferrer) ? NeverSendReferrer : MaybeSendReferrer); sendPings(kurl);}
开发者ID:kcomkar,项目名称:webkit,代码行数:31,
示例9: setNeedsWidgetUpdatevoid HTMLObjectElement::parseMappedAttribute(Attribute* attr){ if (attr->name() == typeAttr) { m_serviceType = attr->value().lower(); size_t pos = m_serviceType.find(";"); if (pos != notFound) m_serviceType = m_serviceType.left(pos); if (renderer()) setNeedsWidgetUpdate(true); if (!isImageType() && m_imageLoader) m_imageLoader.clear(); } else if (attr->name() == dataAttr) { m_url = stripLeadingAndTrailingHTMLSpaces(attr->value()); if (renderer()) { setNeedsWidgetUpdate(true); if (isImageType()) { if (!m_imageLoader) m_imageLoader = adoptPtr(new HTMLImageLoader(this)); m_imageLoader->updateFromElementIgnoringPreviousError(); } } } else if (attr->name() == classidAttr) { m_classId = attr->value(); if (renderer()) setNeedsWidgetUpdate(true); } else if (attr->name() == onloadAttr) setAttributeEventListener(eventNames().loadEvent, NULL_METHOD_RESULT(this, attr)); else if (attr->name() == onbeforeloadAttr) setAttributeEventListener(eventNames().beforeloadEvent, NULL_METHOD_RESULT(this, attr)); else if (attr->name() == nameAttr) { const AtomicString& newName = attr->value(); if (isDocNamedItem() && inDocument() && document()->isHTMLDocument()) { HTMLDocument* document = static_cast<HTMLDocument*>(this->document()); document->removeNamedItem(m_name); document->addNamedItem(newName); } m_name = newName; } else if (attr->name() == borderAttr) { addCSSLength(attr, CSSPropertyBorderWidth, attr->value().toInt() ? attr->value() : "0"); addCSSProperty(attr, CSSPropertyBorderTopStyle, CSSValueSolid); addCSSProperty(attr, CSSPropertyBorderRightStyle, CSSValueSolid); addCSSProperty(attr, CSSPropertyBorderBottomStyle, CSSValueSolid); addCSSProperty(attr, CSSPropertyBorderLeftStyle, CSSValueSolid); } else if (isIdAttributeName(attr->name())) { const AtomicString& newId = attr->value(); if (isDocNamedItem() && inDocument() && document()->isHTMLDocument()) { HTMLDocument* document = static_cast<HTMLDocument*>(this->document()); document->removeExtraNamedItem(m_id); document->addExtraNamedItem(newId); } m_id = newId; // also call superclass HTMLPlugInImageElement::parseMappedAttribute(attr); } else HTMLPlugInImageElement::parseMappedAttribute(attr);}
开发者ID:studiomobile,项目名称:webcore,代码行数:56,
示例10: ENABLEKURL Element::getURLAttribute(const QualifiedName& name) const{#if ENABLE(ASSERT) if (elementData()) { if (const Attribute* attribute = attributes().find(name)) ASSERT(isURLAttribute(*attribute)); }#endif return document().completeURL(stripLeadingAndTrailingHTMLSpaces(getAttribute(name)));}
开发者ID:ksimbili,项目名称:sky_engine,代码行数:10,
示例11: ENABLEString HTMLImageLoader::sourceURI(const AtomicString& attr) const{#if ENABLE(DASHBOARD_SUPPORT) Settings* settings = client()->sourceElement()->document()->settings(); if (settings && settings->usesDashboardBackwardCompatibilityMode() && attr.length() > 7 && attr.startsWith("url(/"") && attr.endsWith("/")")) return attr.string().substring(5, attr.length() - 7);#endif return stripLeadingAndTrailingHTMLSpaces(attr);}
开发者ID:dog-god,项目名称:iptv,代码行数:10,
示例12: fastGetAttributeKURL HTMLBaseElement::href() const{ // This does not use the getURLAttribute function because that will resolve relative to the document's base URL; // base elements like this one can be used to set that base URL. Thus we need to resolve relative to the document's // URL and ignore the base URL. const AtomicString& attributeValue = fastGetAttribute(hrefAttr); if (attributeValue.isNull()) return document().url(); KURL url = document().encoding().isValid() ? KURL(document().url(), stripLeadingAndTrailingHTMLSpaces(attributeValue)) : KURL(document().url(), stripLeadingAndTrailingHTMLSpaces(attributeValue), document().encoding()); if (!url.isValid()) return KURL(); return url;}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:19,
示例13: semicolonSeparatedValueContainingJavaScriptURLstatic String semicolonSeparatedValueContainingJavaScriptURL(const String& value){ Vector<String> valueList; value.split(';', valueList); for (size_t i = 0; i < valueList.size(); ++i) { String stripped = stripLeadingAndTrailingHTMLSpaces(valueList[i]); if (protocolIsJavaScript(stripped)) return stripped; } return emptyString();}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:11,
示例14: youTubeURLString YouTubePluginReplacement::youTubeURL(const String& srcString){ URL srcURL = m_parentElement->document().completeURL(stripLeadingAndTrailingHTMLSpaces(srcString)); bool isYouTubeShortenedURL = false; URL youTubeURL = processAndCreateYouTubeURL(srcURL, isYouTubeShortenedURL); if (srcURL.isEmpty() || youTubeURL.isEmpty()) return srcString; // Transform the youtubeURL (youtube:VideoID) to iframe embed url which has the format: http://www.youtube.com/embed/VideoID const String& srcPath = srcURL.path(); const String& videoID = youTubeURL.string().substring(youTubeURL.protocol().length() + 1); size_t locationOfVideoIDInPath = srcPath.find(videoID); size_t locationOfPathBeforeVideoID = notFound; if (locationOfVideoIDInPath != notFound) { ASSERT(locationOfVideoIDInPath); // From the original URL, we need to get the part before /path/VideoId. locationOfPathBeforeVideoID = srcString.find(srcPath.substring(0, locationOfVideoIDInPath)); } else if (srcPath.lower() == "/watch") { // From the original URL, we need to get the part before /watch/#!v=VideoID locationOfPathBeforeVideoID = srcString.find("/watch"); } else return srcString; ASSERT(locationOfPathBeforeVideoID != notFound); const String& srcURLPrefix = srcString.substring(0, locationOfPathBeforeVideoID); String query = srcURL.query(); // By default, the iframe will display information like the video title and uploader on top of the video. Don't display // them if the embeding html doesn't specify it. if (!query.isEmpty() && !query.contains("showinfo")) query.append("&showinfo=0"); else query = "showinfo=0"; // Append the query string if it is valid. Some sites apparently forget to add "?" for the query string, in that case, // we will discard the parameters in the url. // See: <rdar://problem/11535155> StringBuilder finalURL; if (isYouTubeShortenedURL) finalURL.append("http://www.youtube.com"); else finalURL.append(srcURLPrefix); finalURL.appendLiteral("/embed/"); finalURL.append(videoID); if (!query.isEmpty()) { finalURL.appendLiteral("?"); finalURL.append(query); } return finalURL.toString();}
开发者ID:feel2d,项目名称:webkit,代码行数:54,
示例15: avoidDownloadIfHigherDensityResourceIsInCachestatic unsigned avoidDownloadIfHigherDensityResourceIsInCache(Vector<ImageCandidate*>& imageCandidates, unsigned winner, Document* document){ if (!document) return winner; for (unsigned i = imageCandidates.size() - 1; i > winner; --i) { KURL url = document->completeURL(stripLeadingAndTrailingHTMLSpaces(imageCandidates[i]->url())); if (memoryCache()->resourceForURL(url, document->fetcher()->getCacheIdentifier())) return i; } return winner;}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:11,
示例16: getURLForImageElementstatic URL getURLForImageElement(Element& element){ // FIXME: Later this code should be shared with Chromium somehow. Chances are all platforms want it. AtomicString urlString; if (isHTMLImageElement(element) || isHTMLInputElement(element)) urlString = element.getAttribute(HTMLNames::srcAttr); else if (element.hasTagName(SVGNames::imageTag)) urlString = element.getAttribute(XLinkNames::hrefAttr); else if (element.hasTagName(HTMLNames::embedTag) || isHTMLObjectElement(element)) urlString = element.imageSourceURL(); return urlString.isEmpty() ? URL() : element.document().completeURL(stripLeadingAndTrailingHTMLSpaces(urlString));}
开发者ID:Wrichik1999,项目名称:webkit,代码行数:13,
示例17: ASSERTvoid Editor::writeImageToPasteboard(Pasteboard& pasteboard, Element& imageElement, const URL&, const String& title){ PasteboardImage pasteboardImage; if (!getImageForElement(imageElement, pasteboardImage.image)) return; ASSERT(pasteboardImage.image); pasteboardImage.url.url = imageElement.document().completeURL(stripLeadingAndTrailingHTMLSpaces(elementURL(imageElement))); pasteboardImage.url.title = title; pasteboardImage.url.markup = createMarkup(imageElement, IncludeNode, nullptr, ResolveAllURLs); pasteboard.write(pasteboardImage);}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:13,
示例18: typeMismatchForbool EmailInputType::typeMismatchFor(const String& value) const{ if (value.isEmpty()) return false; if (!element()->multiple()) return !isValidEmailAddress(value); Vector<String> addresses; value.split(',', true, addresses); for (unsigned i = 0; i < addresses.size(); ++i) { if (!isValidEmailAddress(stripLeadingAndTrailingHTMLSpaces(addresses[i]))) return true; } return false;}
开发者ID:pial003,项目名称:RespImg-WebCore,代码行数:14,
示例19: String// The return value is an invalid email address string if the specified string// contains an invalid email address. Otherwise, null string is returned.// If an empty string is returned, it means empty address is specified.// e.g. "[email C++ stripLineInvisibleChars函数代码示例 C++ strip函数代码示例
|