| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
| 8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 { | 220 { |
| 221 ASSERT(hasRareData()); | 221 ASSERT(hasRareData()); |
| 222 return static_cast<ElementRareData*>(rareData()); | 222 return static_cast<ElementRareData*>(rareData()); |
| 223 } | 223 } |
| 224 | 224 |
| 225 inline ElementRareData& Element::ensureElementRareData() | 225 inline ElementRareData& Element::ensureElementRareData() |
| 226 { | 226 { |
| 227 return static_cast<ElementRareData&>(ensureRareData()); | 227 return static_cast<ElementRareData&>(ensureRareData()); |
| 228 } | 228 } |
| 229 | 229 |
| 230 bool Element::hasElementFlagInternal(ElementFlags mask) const |
| 231 { |
| 232 ASSERT(hasRareData()); |
| 233 return elementRareData()->hasFlag(mask); |
| 234 } |
| 235 |
| 236 void Element::setElementFlag(ElementFlags mask, bool value) |
| 237 { |
| 238 if (!hasRareData() && !value) |
| 239 return; |
| 240 ensureElementRareData().setFlag(mask, value); |
| 241 } |
| 242 |
| 243 void Element::clearElementFlag(ElementFlags mask) |
| 244 { |
| 245 if (!hasRareData()) |
| 246 return; |
| 247 elementRareData()->clearFlag(mask); |
| 248 } |
| 249 |
| 230 void Element::clearTabIndexExplicitlyIfNeeded() | 250 void Element::clearTabIndexExplicitlyIfNeeded() |
| 231 { | 251 { |
| 232 if (hasRareData()) | 252 if (hasRareData()) |
| 233 elementRareData()->clearTabIndexExplicitly(); | 253 elementRareData()->clearTabIndexExplicitly(); |
| 234 } | 254 } |
| 235 | 255 |
| 236 void Element::setTabIndexExplicitly(short tabIndex) | 256 void Element::setTabIndexExplicitly(short tabIndex) |
| 237 { | 257 { |
| 238 ensureElementRareData().setTabIndexExplicitly(tabIndex); | 258 ensureElementRareData().setTabIndexExplicitly(tabIndex); |
| 239 } | 259 } |
| 240 | 260 |
| 241 bool Element::supportsFocus() const | |
| 242 { | |
| 243 return hasRareData() && elementRareData()->tabIndexSetExplicitly(); | |
| 244 } | |
| 245 | |
| 246 short Element::tabIndex() const | 261 short Element::tabIndex() const |
| 247 { | 262 { |
| 248 return hasRareData() ? elementRareData()->tabIndex() : 0; | 263 return hasRareData() ? elementRareData()->tabIndex() : 0; |
| 249 } | 264 } |
| 250 | 265 |
| 251 bool Element::rendererIsFocusable() const | 266 bool Element::rendererIsFocusable() const |
| 252 { | 267 { |
| 253 // Elements in canvas fallback content are not rendered, but they are allowe
d to be | 268 // Elements in canvas fallback content are not rendered, but they are allowe
d to be |
| 254 // focusable as long as their canvas is displayed and visible. | 269 // focusable as long as their canvas is displayed and visible. |
| 255 if (isInCanvasSubtree()) { | 270 if (isInCanvasSubtree()) { |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 if (wasInDocument) { | 1396 if (wasInDocument) { |
| 1382 if (hasPendingResources()) | 1397 if (hasPendingResources()) |
| 1383 document().accessSVGExtensions().removeElementFromPendingResources(t
his); | 1398 document().accessSVGExtensions().removeElementFromPendingResources(t
his); |
| 1384 | 1399 |
| 1385 if (isUpgradedCustomElement()) | 1400 if (isUpgradedCustomElement()) |
| 1386 CustomElement::didLeaveDocument(this, insertionPoint->document()); | 1401 CustomElement::didLeaveDocument(this, insertionPoint->document()); |
| 1387 } | 1402 } |
| 1388 | 1403 |
| 1389 document().removeFromTopLayer(this); | 1404 document().removeFromTopLayer(this); |
| 1390 | 1405 |
| 1391 if (hasRareData()) | 1406 clearElementFlag(IsInCanvasSubtree); |
| 1392 elementRareData()->setIsInCanvasSubtree(false); | |
| 1393 } | 1407 } |
| 1394 | 1408 |
| 1395 void Element::attach(const AttachContext& context) | 1409 void Element::attach(const AttachContext& context) |
| 1396 { | 1410 { |
| 1397 ASSERT(document().inStyleRecalc()); | 1411 ASSERT(document().inStyleRecalc()); |
| 1398 | 1412 |
| 1399 StyleResolverParentPusher parentPusher(*this); | 1413 StyleResolverParentPusher parentPusher(*this); |
| 1400 | 1414 |
| 1401 // We've already been through detach when doing an attach, but we might | 1415 // We've already been through detach when doing an attach, but we might |
| 1402 // need to clear any state that's been added since then. | 1416 // need to clear any state that's been added since then. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1423 parentPusher.push(); | 1437 parentPusher.push(); |
| 1424 } | 1438 } |
| 1425 | 1439 |
| 1426 ContainerNode::attach(context); | 1440 ContainerNode::attach(context); |
| 1427 | 1441 |
| 1428 createPseudoElementIfNeeded(AFTER); | 1442 createPseudoElementIfNeeded(AFTER); |
| 1429 createPseudoElementIfNeeded(BACKDROP); | 1443 createPseudoElementIfNeeded(BACKDROP); |
| 1430 | 1444 |
| 1431 if (hasRareData()) { | 1445 if (hasRareData()) { |
| 1432 ElementRareData* data = elementRareData(); | 1446 ElementRareData* data = elementRareData(); |
| 1433 if (data->needsFocusAppearanceUpdateSoonAfterAttach()) { | 1447 if (data->hasFlag(NeedsFocusAppearanceUpdateSoonAfterAttach)) { |
| 1434 if (isFocusable() && document().focusedElement() == this) | 1448 if (isFocusable() && document().focusedElement() == this) |
| 1435 document().updateFocusAppearanceSoon(false /* don't restore sele
ction */); | 1449 document().updateFocusAppearanceSoon(false /* don't restore sele
ction */); |
| 1436 data->setNeedsFocusAppearanceUpdateSoonAfterAttach(false); | 1450 data->clearFlag(NeedsFocusAppearanceUpdateSoonAfterAttach); |
| 1437 } | 1451 } |
| 1438 if (!renderer()) { | 1452 if (!renderer()) { |
| 1439 if (ActiveAnimations* activeAnimations = data->activeAnimations()) { | 1453 if (ActiveAnimations* activeAnimations = data->activeAnimations()) { |
| 1440 activeAnimations->cssAnimations().cancel(); | 1454 activeAnimations->cssAnimations().cancel(); |
| 1441 activeAnimations->setAnimationStyleChange(false); | 1455 activeAnimations->setAnimationStyleChange(false); |
| 1442 } | 1456 } |
| 1443 } | 1457 } |
| 1444 } | 1458 } |
| 1445 | 1459 |
| 1446 InspectorInstrumentation::didRecalculateStyleForElement(this); | 1460 InspectorInstrumentation::didRecalculateStyleForElement(this); |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2165 // does not make sense to continue and update appearence. | 2179 // does not make sense to continue and update appearence. |
| 2166 protect = this; | 2180 protect = this; |
| 2167 if (!page->focusController().setFocusedElement(this, doc.frame(), type)) | 2181 if (!page->focusController().setFocusedElement(this, doc.frame(), type)) |
| 2168 return; | 2182 return; |
| 2169 } | 2183 } |
| 2170 | 2184 |
| 2171 // Setting the focused node above might have invalidated the layout due to s
cripts. | 2185 // Setting the focused node above might have invalidated the layout due to s
cripts. |
| 2172 doc.updateLayoutIgnorePendingStylesheets(); | 2186 doc.updateLayoutIgnorePendingStylesheets(); |
| 2173 | 2187 |
| 2174 if (!isFocusable()) { | 2188 if (!isFocusable()) { |
| 2175 ensureElementRareData().setNeedsFocusAppearanceUpdateSoonAfterAttach(tru
e); | 2189 setElementFlag(NeedsFocusAppearanceUpdateSoonAfterAttach); |
| 2176 return; | 2190 return; |
| 2177 } | 2191 } |
| 2178 | 2192 |
| 2179 cancelFocusAppearanceUpdate(); | 2193 cancelFocusAppearanceUpdate(); |
| 2180 updateFocusAppearance(restorePreviousSelection); | 2194 updateFocusAppearance(restorePreviousSelection); |
| 2181 } | 2195 } |
| 2182 | 2196 |
| 2183 void Element::updateFocusAppearance(bool /*restorePreviousSelection*/) | 2197 void Element::updateFocusAppearance(bool /*restorePreviousSelection*/) |
| 2184 { | 2198 { |
| 2185 if (isRootEditableElement()) { | 2199 if (isRootEditableElement()) { |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2500 // FIXME: Try to do better than this. Ensure that styleForElement() work
s for elements that are not in the | 2514 // FIXME: Try to do better than this. Ensure that styleForElement() work
s for elements that are not in the |
| 2501 // document tree and figure out when to destroy the computed style for s
uch elements. | 2515 // document tree and figure out when to destroy the computed style for s
uch elements. |
| 2502 return 0; | 2516 return 0; |
| 2503 | 2517 |
| 2504 ElementRareData& rareData = ensureElementRareData(); | 2518 ElementRareData& rareData = ensureElementRareData(); |
| 2505 if (!rareData.computedStyle()) | 2519 if (!rareData.computedStyle()) |
| 2506 rareData.setComputedStyle(document().styleForElementIgnoringPendingStyle
sheets(this)); | 2520 rareData.setComputedStyle(document().styleForElementIgnoringPendingStyle
sheets(this)); |
| 2507 return pseudoElementSpecifier ? rareData.computedStyle()->getCachedPseudoSty
le(pseudoElementSpecifier) : rareData.computedStyle(); | 2521 return pseudoElementSpecifier ? rareData.computedStyle()->getCachedPseudoSty
le(pseudoElementSpecifier) : rareData.computedStyle(); |
| 2508 } | 2522 } |
| 2509 | 2523 |
| 2510 void Element::setStyleAffectedByEmpty() | |
| 2511 { | |
| 2512 ensureElementRareData().setStyleAffectedByEmpty(true); | |
| 2513 } | |
| 2514 | |
| 2515 void Element::setChildrenAffectedByFocus() | |
| 2516 { | |
| 2517 ensureElementRareData().setChildrenAffectedByFocus(true); | |
| 2518 } | |
| 2519 | |
| 2520 void Element::setChildrenAffectedByHover() | |
| 2521 { | |
| 2522 ensureElementRareData().setChildrenAffectedByHover(true); | |
| 2523 } | |
| 2524 | |
| 2525 void Element::setChildrenAffectedByActive() | |
| 2526 { | |
| 2527 ensureElementRareData().setChildrenAffectedByActive(true); | |
| 2528 } | |
| 2529 | |
| 2530 void Element::setChildrenAffectedByDrag() | |
| 2531 { | |
| 2532 ensureElementRareData().setChildrenAffectedByDrag(true); | |
| 2533 } | |
| 2534 | |
| 2535 void Element::setChildrenAffectedByFirstChildRules() | |
| 2536 { | |
| 2537 ensureElementRareData().setChildrenAffectedByFirstChildRules(true); | |
| 2538 } | |
| 2539 | |
| 2540 void Element::setChildrenAffectedByLastChildRules() | |
| 2541 { | |
| 2542 ensureElementRareData().setChildrenAffectedByLastChildRules(true); | |
| 2543 } | |
| 2544 | |
| 2545 void Element::setChildrenAffectedByDirectAdjacentRules() | |
| 2546 { | |
| 2547 ensureElementRareData().setChildrenAffectedByDirectAdjacentRules(true); | |
| 2548 } | |
| 2549 | |
| 2550 void Element::setChildrenAffectedByForwardPositionalRules() | |
| 2551 { | |
| 2552 ensureElementRareData().setChildrenAffectedByForwardPositionalRules(true); | |
| 2553 } | |
| 2554 | |
| 2555 void Element::setChildrenAffectedByBackwardPositionalRules() | |
| 2556 { | |
| 2557 ensureElementRareData().setChildrenAffectedByBackwardPositionalRules(true); | |
| 2558 } | |
| 2559 | |
| 2560 void Element::setChildIndex(unsigned index) | 2524 void Element::setChildIndex(unsigned index) |
| 2561 { | 2525 { |
| 2562 ElementRareData& rareData = ensureElementRareData(); | 2526 ElementRareData& rareData = ensureElementRareData(); |
| 2563 if (RenderStyle* style = renderStyle()) | 2527 if (RenderStyle* style = renderStyle()) |
| 2564 style->setUnique(); | 2528 style->setUnique(); |
| 2565 rareData.setChildIndex(index); | 2529 rareData.setChildIndex(index); |
| 2566 } | 2530 } |
| 2567 | 2531 |
| 2568 bool Element::childrenSupportStyleSharing() const | |
| 2569 { | |
| 2570 if (!hasRareData()) | |
| 2571 return true; | |
| 2572 return !rareDataChildrenAffectedByFocus() | |
| 2573 && !rareDataChildrenAffectedByHover() | |
| 2574 && !rareDataChildrenAffectedByActive() | |
| 2575 && !rareDataChildrenAffectedByDrag() | |
| 2576 && !rareDataChildrenAffectedByFirstChildRules() | |
| 2577 && !rareDataChildrenAffectedByLastChildRules() | |
| 2578 && !rareDataChildrenAffectedByDirectAdjacentRules() | |
| 2579 && !rareDataChildrenAffectedByForwardPositionalRules() | |
| 2580 && !rareDataChildrenAffectedByBackwardPositionalRules(); | |
| 2581 } | |
| 2582 | |
| 2583 bool Element::rareDataStyleAffectedByEmpty() const | |
| 2584 { | |
| 2585 ASSERT(hasRareData()); | |
| 2586 return elementRareData()->styleAffectedByEmpty(); | |
| 2587 } | |
| 2588 | |
| 2589 bool Element::rareDataChildrenAffectedByFocus() const | |
| 2590 { | |
| 2591 ASSERT(hasRareData()); | |
| 2592 return elementRareData()->childrenAffectedByFocus(); | |
| 2593 } | |
| 2594 | |
| 2595 bool Element::rareDataChildrenAffectedByHover() const | |
| 2596 { | |
| 2597 ASSERT(hasRareData()); | |
| 2598 return elementRareData()->childrenAffectedByHover(); | |
| 2599 } | |
| 2600 | |
| 2601 bool Element::rareDataChildrenAffectedByActive() const | |
| 2602 { | |
| 2603 ASSERT(hasRareData()); | |
| 2604 return elementRareData()->childrenAffectedByActive(); | |
| 2605 } | |
| 2606 | |
| 2607 bool Element::rareDataChildrenAffectedByDrag() const | |
| 2608 { | |
| 2609 ASSERT(hasRareData()); | |
| 2610 return elementRareData()->childrenAffectedByDrag(); | |
| 2611 } | |
| 2612 | |
| 2613 bool Element::rareDataChildrenAffectedByFirstChildRules() const | |
| 2614 { | |
| 2615 ASSERT(hasRareData()); | |
| 2616 return elementRareData()->childrenAffectedByFirstChildRules(); | |
| 2617 } | |
| 2618 | |
| 2619 bool Element::rareDataChildrenAffectedByLastChildRules() const | |
| 2620 { | |
| 2621 ASSERT(hasRareData()); | |
| 2622 return elementRareData()->childrenAffectedByLastChildRules(); | |
| 2623 } | |
| 2624 | |
| 2625 bool Element::rareDataChildrenAffectedByDirectAdjacentRules() const | |
| 2626 { | |
| 2627 ASSERT(hasRareData()); | |
| 2628 return elementRareData()->childrenAffectedByDirectAdjacentRules(); | |
| 2629 } | |
| 2630 | |
| 2631 bool Element::rareDataChildrenAffectedByForwardPositionalRules() const | |
| 2632 { | |
| 2633 ASSERT(hasRareData()); | |
| 2634 return elementRareData()->childrenAffectedByForwardPositionalRules(); | |
| 2635 } | |
| 2636 | |
| 2637 bool Element::rareDataChildrenAffectedByBackwardPositionalRules() const | |
| 2638 { | |
| 2639 ASSERT(hasRareData()); | |
| 2640 return elementRareData()->childrenAffectedByBackwardPositionalRules(); | |
| 2641 } | |
| 2642 | |
| 2643 unsigned Element::rareDataChildIndex() const | 2532 unsigned Element::rareDataChildIndex() const |
| 2644 { | 2533 { |
| 2645 ASSERT(hasRareData()); | 2534 ASSERT(hasRareData()); |
| 2646 return elementRareData()->childIndex(); | 2535 return elementRareData()->childIndex(); |
| 2647 } | 2536 } |
| 2648 | 2537 |
| 2649 void Element::setIsInCanvasSubtree(bool isInCanvasSubtree) | |
| 2650 { | |
| 2651 ensureElementRareData().setIsInCanvasSubtree(isInCanvasSubtree); | |
| 2652 } | |
| 2653 | |
| 2654 bool Element::isInCanvasSubtree() const | |
| 2655 { | |
| 2656 return hasRareData() && elementRareData()->isInCanvasSubtree(); | |
| 2657 } | |
| 2658 | |
| 2659 AtomicString Element::computeInheritedLanguage() const | 2538 AtomicString Element::computeInheritedLanguage() const |
| 2660 { | 2539 { |
| 2661 const Node* n = this; | 2540 const Node* n = this; |
| 2662 AtomicString value; | 2541 AtomicString value; |
| 2663 // The language property is inherited, so we iterate over the parents to fin
d the first language. | 2542 // The language property is inherited, so we iterate over the parents to fin
d the first language. |
| 2664 do { | 2543 do { |
| 2665 if (n->isElementNode()) { | 2544 if (n->isElementNode()) { |
| 2666 if (const ElementData* elementData = toElement(n)->elementData()) { | 2545 if (const ElementData* elementData = toElement(n)->elementData()) { |
| 2667 // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml
1/#C_7 | 2546 // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml
1/#C_7 |
| 2668 if (const Attribute* attribute = elementData->getAttributeItem(X
MLNames::langAttr)) | 2547 if (const Attribute* attribute = elementData->getAttributeItem(X
MLNames::langAttr)) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2682 } | 2561 } |
| 2683 | 2562 |
| 2684 Locale& Element::locale() const | 2563 Locale& Element::locale() const |
| 2685 { | 2564 { |
| 2686 return document().getCachedLocale(computeInheritedLanguage()); | 2565 return document().getCachedLocale(computeInheritedLanguage()); |
| 2687 } | 2566 } |
| 2688 | 2567 |
| 2689 void Element::cancelFocusAppearanceUpdate() | 2568 void Element::cancelFocusAppearanceUpdate() |
| 2690 { | 2569 { |
| 2691 if (hasRareData()) | 2570 if (hasRareData()) |
| 2692 elementRareData()->setNeedsFocusAppearanceUpdateSoonAfterAttach(false); | 2571 clearElementFlag(NeedsFocusAppearanceUpdateSoonAfterAttach); |
| 2693 if (document().focusedElement() == this) | 2572 if (document().focusedElement() == this) |
| 2694 document().cancelFocusAppearanceUpdate(); | 2573 document().cancelFocusAppearanceUpdate(); |
| 2695 } | 2574 } |
| 2696 | 2575 |
| 2697 void Element::normalizeAttributes() | 2576 void Element::normalizeAttributes() |
| 2698 { | 2577 { |
| 2699 if (!hasAttributes()) | 2578 if (!hasAttributes()) |
| 2700 return; | 2579 return; |
| 2701 // attributeCount() cannot be cached before the loop because the attributes | 2580 // attributeCount() cannot be cached before the loop because the attributes |
| 2702 // list is altered while iterating. | 2581 // list is altered while iterating. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2851 void Element::webkitRequestFullscreen() | 2730 void Element::webkitRequestFullscreen() |
| 2852 { | 2731 { |
| 2853 FullscreenElementStack::from(document()).requestFullScreenForElement(this, A
LLOW_KEYBOARD_INPUT, FullscreenElementStack::EnforceIFrameAllowFullScreenRequire
ment); | 2732 FullscreenElementStack::from(document()).requestFullScreenForElement(this, A
LLOW_KEYBOARD_INPUT, FullscreenElementStack::EnforceIFrameAllowFullScreenRequire
ment); |
| 2854 } | 2733 } |
| 2855 | 2734 |
| 2856 void Element::webkitRequestFullScreen(unsigned short flags) | 2735 void Element::webkitRequestFullScreen(unsigned short flags) |
| 2857 { | 2736 { |
| 2858 FullscreenElementStack::from(document()).requestFullScreenForElement(this, (
flags | LEGACY_MOZILLA_REQUEST), FullscreenElementStack::EnforceIFrameAllowFullS
creenRequirement); | 2737 FullscreenElementStack::from(document()).requestFullScreenForElement(this, (
flags | LEGACY_MOZILLA_REQUEST), FullscreenElementStack::EnforceIFrameAllowFullS
creenRequirement); |
| 2859 } | 2738 } |
| 2860 | 2739 |
| 2861 bool Element::containsFullScreenElement() const | |
| 2862 { | |
| 2863 return hasRareData() && elementRareData()->containsFullScreenElement(); | |
| 2864 } | |
| 2865 | |
| 2866 void Element::setContainsFullScreenElement(bool flag) | 2740 void Element::setContainsFullScreenElement(bool flag) |
| 2867 { | 2741 { |
| 2868 ensureElementRareData().setContainsFullScreenElement(flag); | 2742 setElementFlag(ContainsFullScreenElement, flag); |
| 2869 setNeedsStyleRecalc(SubtreeStyleChange); | 2743 setNeedsStyleRecalc(SubtreeStyleChange); |
| 2870 } | 2744 } |
| 2871 | 2745 |
| 2872 static Element* parentCrossingFrameBoundaries(Element* element) | 2746 static Element* parentCrossingFrameBoundaries(Element* element) |
| 2873 { | 2747 { |
| 2874 ASSERT(element); | 2748 ASSERT(element); |
| 2875 return element->parentElement() ? element->parentElement() : element->docume
nt().ownerElement(); | 2749 return element->parentElement() ? element->parentElement() : element->docume
nt().ownerElement(); |
| 2876 } | 2750 } |
| 2877 | 2751 |
| 2878 void Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(boo
l flag) | 2752 void Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(boo
l flag) |
| 2879 { | 2753 { |
| 2880 Element* element = this; | 2754 Element* element = this; |
| 2881 while ((element = parentCrossingFrameBoundaries(element))) | 2755 while ((element = parentCrossingFrameBoundaries(element))) |
| 2882 element->setContainsFullScreenElement(flag); | 2756 element->setContainsFullScreenElement(flag); |
| 2883 } | 2757 } |
| 2884 | 2758 |
| 2885 bool Element::isInTopLayer() const | |
| 2886 { | |
| 2887 return hasRareData() && elementRareData()->isInTopLayer(); | |
| 2888 } | |
| 2889 | |
| 2890 void Element::setIsInTopLayer(bool inTopLayer) | 2759 void Element::setIsInTopLayer(bool inTopLayer) |
| 2891 { | 2760 { |
| 2892 if (isInTopLayer() == inTopLayer) | 2761 if (isInTopLayer() == inTopLayer) |
| 2893 return; | 2762 return; |
| 2894 ensureElementRareData().setIsInTopLayer(inTopLayer); | 2763 setElementFlag(IsInTopLayer, inTopLayer); |
| 2895 | 2764 |
| 2896 // We must ensure a reattach occurs so the renderer is inserted in the corre
ct sibling order under RenderView according to its | 2765 // We must ensure a reattach occurs so the renderer is inserted in the corre
ct sibling order under RenderView according to its |
| 2897 // top layer position, or in its usual place if not in the top layer. | 2766 // top layer position, or in its usual place if not in the top layer. |
| 2898 lazyReattachIfAttached(); | 2767 lazyReattachIfAttached(); |
| 2899 } | 2768 } |
| 2900 | 2769 |
| 2901 void Element::webkitRequestPointerLock() | 2770 void Element::webkitRequestPointerLock() |
| 2902 { | 2771 { |
| 2903 if (document().page()) | 2772 if (document().page()) |
| 2904 document().page()->pointerLockController().requestPointerLock(this); | 2773 document().page()->pointerLockController().requestPointerLock(this); |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3312 InputMethodContext& Element::inputMethodContext() | 3181 InputMethodContext& Element::inputMethodContext() |
| 3313 { | 3182 { |
| 3314 return ensureElementRareData().ensureInputMethodContext(toHTMLElement(this))
; | 3183 return ensureElementRareData().ensureInputMethodContext(toHTMLElement(this))
; |
| 3315 } | 3184 } |
| 3316 | 3185 |
| 3317 bool Element::hasInputMethodContext() const | 3186 bool Element::hasInputMethodContext() const |
| 3318 { | 3187 { |
| 3319 return hasRareData() && elementRareData()->hasInputMethodContext(); | 3188 return hasRareData() && elementRareData()->hasInputMethodContext(); |
| 3320 } | 3189 } |
| 3321 | 3190 |
| 3322 bool Element::hasPendingResources() const | |
| 3323 { | |
| 3324 return hasRareData() && elementRareData()->hasPendingResources(); | |
| 3325 } | |
| 3326 | |
| 3327 void Element::setHasPendingResources() | |
| 3328 { | |
| 3329 ensureElementRareData().setHasPendingResources(true); | |
| 3330 } | |
| 3331 | |
| 3332 void Element::clearHasPendingResources() | |
| 3333 { | |
| 3334 ensureElementRareData().setHasPendingResources(false); | |
| 3335 } | |
| 3336 | |
| 3337 void Element::synchronizeStyleAttributeInternal() const | 3191 void Element::synchronizeStyleAttributeInternal() const |
| 3338 { | 3192 { |
| 3339 ASSERT(isStyledElement()); | 3193 ASSERT(isStyledElement()); |
| 3340 ASSERT(elementData()); | 3194 ASSERT(elementData()); |
| 3341 ASSERT(elementData()->m_styleAttributeIsDirty); | 3195 ASSERT(elementData()->m_styleAttributeIsDirty); |
| 3342 elementData()->m_styleAttributeIsDirty = false; | 3196 elementData()->m_styleAttributeIsDirty = false; |
| 3343 const StylePropertySet* inlineStyle = this->inlineStyle(); | 3197 const StylePropertySet* inlineStyle = this->inlineStyle(); |
| 3344 const_cast<Element*>(this)->setSynchronizedLazyAttribute(styleAttr, | 3198 const_cast<Element*>(this)->setSynchronizedLazyAttribute(styleAttr, |
| 3345 inlineStyle ? AtomicString(inlineStyle->asText()) : nullAtom); | 3199 inlineStyle ? AtomicString(inlineStyle->asText()) : nullAtom); |
| 3346 } | 3200 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3545 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems | 3399 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems |
| 3546 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 | 3400 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 |
| 3547 if (isHTMLOptionElement(*this) || isHTMLOptGroupElement(*this)) | 3401 if (isHTMLOptionElement(*this) || isHTMLOptGroupElement(*this)) |
| 3548 return false; | 3402 return false; |
| 3549 if (FullscreenElementStack::isActiveFullScreenElement(this)) | 3403 if (FullscreenElementStack::isActiveFullScreenElement(this)) |
| 3550 return false; | 3404 return false; |
| 3551 return true; | 3405 return true; |
| 3552 } | 3406 } |
| 3553 | 3407 |
| 3554 } // namespace WebCore | 3408 } // namespace WebCore |
| OLD | NEW |