예제 #1
0
void VTTCue::updateDisplay(const IntSize& videoSize, HTMLDivElement& container)
{
    RefPtr<VTTCueBox> displayBox = getDisplayTree(videoSize);
    VTTRegion* region = 0;
    if (track()->regions())
        region = track()->regions()->getRegionById(regionId());

    if (!region) {
        // If cue has an empty text track cue region identifier or there is no
        // WebVTT region whose region identifier is identical to cue's text
        // track cue region identifier, run the following substeps:
        if (displayBox->hasChildNodes() && !container.contains(displayBox.get())) {
            // Note: the display tree of a cue is removed when the active flag of the cue is unset.
            container.appendChild(displayBox);
        }
    } else {
        // Let region be the WebVTT region whose region identifier
        // matches the text track cue region identifier of cue.
        RefPtr<HTMLDivElement> regionNode = region->getDisplayTree(document());

        // Append the region to the viewport, if it was not already.
        if (!container.contains(regionNode.get()))
            container.appendChild(regionNode);

        region->appendVTTCueBox(displayBox);
    }
}
예제 #2
0
void VTTCue::updateDisplay(HTMLDivElement& container)
{
    ASSERT(track() && track()->isRendered() && isActive());

    UseCounter::count(document(), UseCounter::VTTCueRender);

    if (m_writingDirection != Horizontal)
        UseCounter::count(document(), UseCounter::VTTCueRenderVertical);

    if (!m_snapToLines)
        UseCounter::count(document(), UseCounter::VTTCueRenderSnapToLinesFalse);

    if (!lineIsAuto())
        UseCounter::count(document(), UseCounter::VTTCueRenderLineNotAuto);

    if (textPositionIsAuto())
        UseCounter::count(document(), UseCounter::VTTCueRenderPositionNot50);

    if (m_cueSize != 100)
        UseCounter::count(document(), UseCounter::VTTCueRenderSizeNot100);

    if (m_cueAlignment != Middle)
        UseCounter::count(document(), UseCounter::VTTCueRenderAlignNotMiddle);

    VTTCueBox* displayBox = getDisplayTree();
    VTTRegion* region = 0;
    if (track()->regions())
        region = track()->regions()->getRegionById(regionId());

    if (!region) {
        // If cue has an empty region identifier or there is no WebVTT region
        // whose region identifier is identical to cue's region identifier, run
        // the following substeps:
        if (displayBox->hasChildren() && !container.contains(displayBox)) {
            // Note: the display tree of a cue is removed when the active flag of the cue is unset.
            container.appendChild(displayBox);
        }
    } else {
        // Let region be the WebVTT region whose region identifier matches the
        // region identifier of cue.
        HTMLDivElement* regionNode = region->getDisplayTree(document());

        // Append the region to the viewport, if it was not already.
        if (!container.contains(regionNode))
            container.appendChild(regionNode);

        region->appendVTTCueBox(displayBox);
    }
}
예제 #3
0
파일: VTTCue.cpp 프로젝트: kjthegod/WebKit
void VTTCue::updateDisplay(const IntSize& videoSize, HTMLDivElement& container)
{
    UseCounter::count(document(), UseCounter::VTTCueRender);

    if (m_writingDirection != Horizontal)
        UseCounter::count(document(), UseCounter::VTTCueRenderVertical);

    if (!m_snapToLines)
        UseCounter::count(document(), UseCounter::VTTCueRenderSnapToLinesFalse);

    if (m_linePosition != undefinedPosition)
        UseCounter::count(document(), UseCounter::VTTCueRenderLineNotAuto);

    if (m_textPosition != 50)
        UseCounter::count(document(), UseCounter::VTTCueRenderPositionNot50);

    if (m_cueSize != 100)
        UseCounter::count(document(), UseCounter::VTTCueRenderSizeNot100);

    if (m_cueAlignment != Middle)
        UseCounter::count(document(), UseCounter::VTTCueRenderAlignNotMiddle);

    RefPtrWillBeRawPtr<VTTCueBox> displayBox = getDisplayTree(videoSize);
    VTTRegion* region = 0;
    if (track()->regions())
        region = track()->regions()->getRegionById(regionId());

    if (!region) {
        // If cue has an empty text track cue region identifier or there is no
        // WebVTT region whose region identifier is identical to cue's text
        // track cue region identifier, run the following substeps:
        if (displayBox->hasChildren() && !container.contains(displayBox.get())) {
            // Note: the display tree of a cue is removed when the active flag of the cue is unset.
            container.appendChild(displayBox);
        }
    } else {
        // Let region be the WebVTT region whose region identifier
        // matches the text track cue region identifier of cue.
        RefPtrWillBeRawPtr<HTMLDivElement> regionNode = region->getDisplayTree(document());

        // Append the region to the viewport, if it was not already.
        if (!container.contains(regionNode.get()))
            container.appendChild(regionNode);

        region->appendVTTCueBox(displayBox);
    }
}
예제 #4
0
// is this entire expression cacheable after this phase?
NABoolean RelRoot::isCacheableExpr(CacheWA& cwa)
{
  //queries prefixed by display are not cacheable e.g. display select * from ...
  if(getDisplayTree())
    return FALSE;
  
  // Parallel extract producer queries are not cacheable
  if (numExtractStreams_ > 0)
    return FALSE;

  // descend to scans early to get cwa.numberOfScans_ 
  if (!RelExpr::isCacheableExpr(cwa)) {
    return FALSE;
  }
  if (cwa.getPhase() == CmpMain::PARSE) {
    if (compExprTree_ || compExpr_.entries() > 0) {
      // insert-returning is not cacheable after parse
      return FALSE; 
    }
  }
  else if (cwa.getPhase() >= CmpMain::BIND) {
    // make sure select list is cacheable
    if (compExprTree_) {
      if (!compExprTree_->isCacheableExpr(cwa)) { 
        return FALSE; 
      }
    }
    else if (!compExpr_.isCacheableExpr(cwa)) {
      return FALSE;
    }
  }

  if (isAnalyzeOnly())
    return FALSE;

  return TRUE;
}