| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. |
| 3 * | 4 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 6 * |
| 6 * Other contributors: | 7 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 11 * Randall Jesup <rjesup@wgate.com> |
| 11 * Roland Mainz <roland.mainz@informatik.med.uni-giessen.de> | 12 * Roland Mainz <roland.mainz@informatik.med.uni-giessen.de> |
| 12 * Josh Soref <timeless@mac.com> | 13 * Josh Soref <timeless@mac.com> |
| 13 * Boris Zbarsky <bzbarsky@mit.edu> | 14 * Boris Zbarsky <bzbarsky@mit.edu> |
| 14 * | 15 * |
| 15 * This library is free software; you can redistribute it and/or | 16 * This library is free software; you can redistribute it and/or |
| 16 * modify it under the terms of the GNU Lesser General Public | 17 * modify it under the terms of the GNU Lesser General Public |
| 17 * License as published by the Free Software Foundation; either | 18 * License as published by the Free Software Foundation; either |
| 18 * version 2.1 of the License, or (at your option) any later version. | 19 * version 2.1 of the License, or (at your option) any later version. |
| 19 * | 20 * |
| 20 * This library is distributed in the hope that it will be useful, | 21 * This library is distributed in the hope that it will be useful, |
| 21 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 22 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 23 * Lesser General Public License for more details. | 24 * Lesser General Public License for more details. |
| 24 * | 25 * |
| 25 * You should have received a copy of the GNU Lesser General Public | 26 * You should have received a copy of the GNU Lesser General Public |
| 26 * License along with this library; if not, write to the Free Software | 27 * License along with this library; if not, write to the Free Software |
| 27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 US
A | 28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
| 28 * | 29 * |
| 29 * Alternatively, the contents of this file may be used under the terms | 30 * Alternatively, the contents of this file may be used under the terms |
| 30 * of either the Mozilla Public License Version 1.1, found at | 31 * of either the Mozilla Public License Version 1.1, found at |
| 31 * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public | 32 * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public |
| 32 * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html | 33 * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html |
| 33 * (the "GPL"), in which case the provisions of the MPL or the GPL are | 34 * (the "GPL"), in which case the provisions of the MPL or the GPL are |
| 34 * applicable instead of those above. If you wish to allow use of your | 35 * applicable instead of those above. If you wish to allow use of your |
| 35 * version of this file only under the terms of one of those two | 36 * version of this file only under the terms of one of those two |
| 36 * licenses (the MPL or the GPL) and not to allow others to use your | 37 * licenses (the MPL or the GPL) and not to allow others to use your |
| 37 * version of this file under the LGPL, indicate your decision by | 38 * version of this file under the LGPL, indicate your decision by |
| (...skipping 22 matching lines...) Expand all Loading... |
| 60 PaintLayerStackingNode::PaintLayerStackingNode(PaintLayer* layer) | 61 PaintLayerStackingNode::PaintLayerStackingNode(PaintLayer* layer) |
| 61 : m_layer(layer) | 62 : m_layer(layer) |
| 62 #if ENABLE(ASSERT) | 63 #if ENABLE(ASSERT) |
| 63 , | 64 , |
| 64 m_layerListMutationAllowed(true), | 65 m_layerListMutationAllowed(true), |
| 65 m_stackingParent(0) | 66 m_stackingParent(0) |
| 66 #endif | 67 #endif |
| 67 { | 68 { |
| 68 m_isStacked = layoutObject()->styleRef().isStacked(); | 69 m_isStacked = layoutObject()->styleRef().isStacked(); |
| 69 | 70 |
| 70 // Non-stacking contexts should have empty z-order lists. As this is already t
he case, | 71 // Non-stacking contexts should have empty z-order lists. As this is already |
| 71 // there is no need to dirty / recompute these lists. | 72 // the case, there is no need to dirty / recompute these lists. |
| 72 m_zOrderListsDirty = isStackingContext(); | 73 m_zOrderListsDirty = isStackingContext(); |
| 73 } | 74 } |
| 74 | 75 |
| 75 PaintLayerStackingNode::~PaintLayerStackingNode() { | 76 PaintLayerStackingNode::~PaintLayerStackingNode() { |
| 76 #if ENABLE(ASSERT) | 77 #if ENABLE(ASSERT) |
| 77 if (!layoutObject()->documentBeingDestroyed()) { | 78 if (!layoutObject()->documentBeingDestroyed()) { |
| 78 ASSERT(!isInStackingParentZOrderLists()); | 79 ASSERT(!isInStackingParentZOrderLists()); |
| 79 | 80 |
| 80 updateStackingParentForZOrderLists(0); | 81 updateStackingParentForZOrderLists(0); |
| 81 } | 82 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 127 |
| 127 // Sort the two lists. | 128 // Sort the two lists. |
| 128 if (m_posZOrderList) | 129 if (m_posZOrderList) |
| 129 std::stable_sort(m_posZOrderList->begin(), m_posZOrderList->end(), | 130 std::stable_sort(m_posZOrderList->begin(), m_posZOrderList->end(), |
| 130 compareZIndex); | 131 compareZIndex); |
| 131 | 132 |
| 132 if (m_negZOrderList) | 133 if (m_negZOrderList) |
| 133 std::stable_sort(m_negZOrderList->begin(), m_negZOrderList->end(), | 134 std::stable_sort(m_negZOrderList->begin(), m_negZOrderList->end(), |
| 134 compareZIndex); | 135 compareZIndex); |
| 135 | 136 |
| 136 // Append layers for top layer elements after normal layer collection, to ensu
re they are on top regardless of z-indexes. | 137 // Append layers for top layer elements after normal layer collection, to |
| 137 // The layoutObjects of top layer elements are children of the view, sorted in
top layer stacking order. | 138 // ensure they are on top regardless of z-indexes. The layoutObjects of top |
| 139 // layer elements are children of the view, sorted in top layer stacking |
| 140 // order. |
| 138 if (layer()->isRootLayer()) { | 141 if (layer()->isRootLayer()) { |
| 139 LayoutBlockFlow* rootBlock = layoutObject()->view(); | 142 LayoutBlockFlow* rootBlock = layoutObject()->view(); |
| 140 // If the viewport is paginated, everything (including "top-layer" elements)
gets | 143 // If the viewport is paginated, everything (including "top-layer" elements) |
| 141 // redirected to the flow thread. So that's where we have to look, in that c
ase. | 144 // gets redirected to the flow thread. So that's where we have to look, in |
| 145 // that case. |
| 142 if (LayoutBlockFlow* multiColumnFlowThread = | 146 if (LayoutBlockFlow* multiColumnFlowThread = |
| 143 rootBlock->multiColumnFlowThread()) | 147 rootBlock->multiColumnFlowThread()) |
| 144 rootBlock = multiColumnFlowThread; | 148 rootBlock = multiColumnFlowThread; |
| 145 for (LayoutObject* child = rootBlock->firstChild(); child; | 149 for (LayoutObject* child = rootBlock->firstChild(); child; |
| 146 child = child->nextSibling()) { | 150 child = child->nextSibling()) { |
| 147 Element* childElement = (child->node() && child->node()->isElementNode()) | 151 Element* childElement = (child->node() && child->node()->isElementNode()) |
| 148 ? toElement(child->node()) | 152 ? toElement(child->node()) |
| 149 : 0; | 153 : 0; |
| 150 if (childElement && childElement->isInTopLayer()) { | 154 if (childElement && childElement->isInTopLayer()) { |
| 151 PaintLayer* layer = toLayoutBoxModelObject(child)->layer(); | 155 PaintLayer* layer = toLayoutBoxModelObject(child)->layer(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 return stackingNode; | 257 return stackingNode; |
| 254 } | 258 } |
| 255 return 0; | 259 return 0; |
| 256 } | 260 } |
| 257 | 261 |
| 258 LayoutBoxModelObject* PaintLayerStackingNode::layoutObject() const { | 262 LayoutBoxModelObject* PaintLayerStackingNode::layoutObject() const { |
| 259 return m_layer->layoutObject(); | 263 return m_layer->layoutObject(); |
| 260 } | 264 } |
| 261 | 265 |
| 262 } // namespace blink | 266 } // namespace blink |
| OLD | NEW |