예제 #1
0
 CheckForVisibilityChangeOnRecalcStyle(Element* element, const RenderStyle* currentStyle)
     : m_element(element)
     , m_previousDisplay(currentStyle ? currentStyle->display() : NONE)
     , m_previousVisibility(currentStyle ? currentStyle->visibility() : HIDDEN)
     , m_previousImplicitVisibility(WKObservingContentChanges() && WKObservedContentChange() != WKContentVisibilityChange ? elementImplicitVisibility(element) : VISIBLE)
 {
 }
예제 #2
0
CheckForVisibilityChange::CheckForVisibilityChange(const Element& element)
    : m_element(element)
    , m_previousDisplay(element.renderStyle() ? element.renderStyle()->display() : NONE)
    , m_previousVisibility(element.renderStyle() ? element.renderStyle()->visibility() : HIDDEN)
    , m_previousImplicitVisibility(WKObservingContentChanges() && WKObservedContentChange() != WKContentVisibilityChange ? elementImplicitVisibility(element) : VISIBLE)
{
}
예제 #3
0
 ~CheckForVisibilityChangeOnRecalcStyle()
 {
     if (!WKObservingContentChanges())
         return;
     RenderStyle* style = m_element->renderStyle();
     if (!style)
         return;
     if ((m_previousDisplay == NONE && style->display() != NONE) || (m_previousVisibility == HIDDEN && style->visibility() != HIDDEN)
         || (m_previousImplicitVisibility == HIDDEN && elementImplicitVisibility(m_element.get()) == VISIBLE))
         WKSetObservedContentChange(WKContentVisibilityChange);
 }
예제 #4
0
CheckForVisibilityChange::~CheckForVisibilityChange()
{
    if (!WKObservingContentChanges())
        return;
    if (m_element.isInUserAgentShadowTree())
        return;
    auto* style = m_element.renderStyle();
    if (!style)
        return;
    if ((m_previousDisplay == NONE && style->display() != NONE) || (m_previousVisibility == HIDDEN && style->visibility() != HIDDEN)
        || (m_previousImplicitVisibility == HIDDEN && elementImplicitVisibility(m_element) == VISIBLE))
        WKSetObservedContentChange(WKContentVisibilityChange);
}