void VTTRegion::displayLastVTTCueBox() { WTF_LOG(Media, "VTTRegion::displayLastVTTCueBox"); ASSERT(m_cueContainer); // FIXME: This should not be causing recalc styles in a loop to set the "top" css // property to move elements. We should just scroll the text track cues on the // compositor with an animation. if (m_scrollTimer.isActive()) return; // If it's a scrolling region, add the scrolling class. if (isScrollingRegion()) m_cueContainer->classList().add(textTrackCueContainerScrollingClass(), ASSERT_NO_EXCEPTION); float regionBottom = m_regionDisplayTree->getBoundingClientRect()->bottom(); // Find first cue that is not entirely displayed and scroll it upwards. for (Element* child = ElementTraversal::firstChild(*m_cueContainer); child && !m_scrollTimer.isActive(); child = ElementTraversal::nextSibling(*child)) { ClientRect* clientRect = child->getBoundingClientRect(); float childTop = clientRect->top(); float childBottom = clientRect->bottom(); if (regionBottom >= childBottom) continue; float height = childBottom - childTop; m_currentTop -= std::min(height, childBottom - regionBottom); m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::UnitType::Pixels); startTimer(); } }
static Element* elementFromCenter(Element& element) { ClientRect* clientRect = element.getBoundingClientRect(); int centerX = static_cast<int>((clientRect->left() + clientRect->right()) / 2); int centerY = static_cast<int>((clientRect->top() + clientRect->bottom()) / 2); return element.document().elementFromPoint(centerX , centerY); }
JSValue jsClientRectHeight(ExecState* exec, JSValue slotBase, const Identifier&) { JSClientRect* castedThis = static_cast<JSClientRect*>(asObject(slotBase)); UNUSED_PARAM(exec); ClientRect* imp = static_cast<ClientRect*>(castedThis->impl()); JSValue result = jsNumber(exec, imp->height()); return result; }
void Report::AddProportionalColumn (int widthPercentage, std::string const & title, ColAlignment align, bool hasImage) { ClientRect rect (H ()); // Revisit: check if total number of items is less then items/per page // and if this is not the case substract from list view client rectangle // width the system width of vertical scroll bar Report::Column column; column.Width ((widthPercentage * rect.Width ()) / 100); column.Align (align); if (!title.empty ()) column.Title (title); column.SubItem (_cColumn); if (hasImage) column.HasImages (); if (ListView_InsertColumn (H (), _cColumn, &column) == -1) throw Win::Exception ("Internal error: Cannot insert column."); _cColumn++; }
static v8::Handle<v8::Value> heightAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.ClientRect.height._get"); ClientRect* imp = V8ClientRect::toNative(info.Holder()); return v8::Number::New(imp->height()); }