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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. |
5 * All rights reserved. | 5 * All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 * | 21 * |
22 */ | 22 */ |
23 | 23 |
24 #include "core/layout/LayoutInline.h" | 24 #include "core/layout/LayoutInline.h" |
25 | 25 |
26 #include "core/dom/Fullscreen.h" | |
27 #include "core/dom/StyleEngine.h" | 26 #include "core/dom/StyleEngine.h" |
28 #include "core/layout/HitTestResult.h" | 27 #include "core/layout/HitTestResult.h" |
29 #include "core/layout/LayoutBlock.h" | 28 #include "core/layout/LayoutBlock.h" |
30 #include "core/layout/LayoutFullScreen.h" | |
31 #include "core/layout/LayoutGeometryMap.h" | 29 #include "core/layout/LayoutGeometryMap.h" |
32 #include "core/layout/LayoutTheme.h" | 30 #include "core/layout/LayoutTheme.h" |
33 #include "core/layout/LayoutView.h" | 31 #include "core/layout/LayoutView.h" |
34 #include "core/layout/api/LineLayoutBoxModel.h" | 32 #include "core/layout/api/LineLayoutBoxModel.h" |
35 #include "core/layout/line/InlineTextBox.h" | 33 #include "core/layout/line/InlineTextBox.h" |
36 #include "core/paint/BoxPainter.h" | 34 #include "core/paint/BoxPainter.h" |
37 #include "core/paint/InlinePainter.h" | 35 #include "core/paint/InlinePainter.h" |
38 #include "core/paint/ObjectPainter.h" | 36 #include "core/paint/ObjectPainter.h" |
39 #include "core/paint/PaintLayer.h" | 37 #include "core/paint/PaintLayer.h" |
40 #include "core/style/StyleInheritedData.h" | 38 #include "core/style/StyleInheritedData.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 } | 387 } |
390 } | 388 } |
391 | 389 |
392 void LayoutInline::splitInlines(LayoutBlockFlow* fromBlock, | 390 void LayoutInline::splitInlines(LayoutBlockFlow* fromBlock, |
393 LayoutBlockFlow* toBlock, | 391 LayoutBlockFlow* toBlock, |
394 LayoutBlockFlow* middleBlock, | 392 LayoutBlockFlow* middleBlock, |
395 LayoutObject* beforeChild, | 393 LayoutObject* beforeChild, |
396 LayoutBoxModelObject* oldCont) { | 394 LayoutBoxModelObject* oldCont) { |
397 ASSERT(isDescendantOf(fromBlock)); | 395 ASSERT(isDescendantOf(fromBlock)); |
398 | 396 |
399 // If we're splitting the inline containing the fullscreened element, | |
400 // |beforeChild| may be the layoutObject for the fullscreened element. | |
401 // However, that layoutObject is wrapped in a LayoutFullScreen, so |this| is | |
402 // not its parent. Since the splitting logic expects |this| to be the parent, | |
403 // set |beforeChild| to be the LayoutFullScreen. | |
404 if (Fullscreen* fullscreen = Fullscreen::fromIfExists(document())) { | |
405 const Element* fullScreenElement = fullscreen->currentFullScreenElement(); | |
406 if (fullScreenElement && beforeChild && | |
407 beforeChild->node() == fullScreenElement) | |
408 beforeChild = fullscreen->fullScreenLayoutObject(); | |
409 } | |
410 | |
411 // FIXME: Because splitting is O(n^2) as tags nest pathologically, we cap the | 397 // FIXME: Because splitting is O(n^2) as tags nest pathologically, we cap the |
412 // depth at which we're willing to clone. | 398 // depth at which we're willing to clone. |
413 // There will eventually be a better approach to this problem that will let us | 399 // There will eventually be a better approach to this problem that will let us |
414 // nest to a much greater depth (see bugzilla bug 13430) but for now we have a | 400 // nest to a much greater depth (see bugzilla bug 13430) but for now we have a |
415 // limit. This *will* result in incorrect rendering, but the alternative is to | 401 // limit. This *will* result in incorrect rendering, but the alternative is to |
416 // hang forever. | 402 // hang forever. |
417 const unsigned cMaxSplitDepth = 200; | 403 const unsigned cMaxSplitDepth = 200; |
418 Vector<LayoutInline*> inlinesToClone; | 404 Vector<LayoutInline*> inlinesToClone; |
419 LayoutInline* topMostInline = this; | 405 LayoutInline* topMostInline = this; |
420 for (LayoutObject* o = this; o != fromBlock; o = o->parent()) { | 406 for (LayoutObject* o = this; o != fromBlock; o = o->parent()) { |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 paintInvalidator.invalidateDisplayItemClient(*box, invalidationReason); | 1500 paintInvalidator.invalidateDisplayItemClient(*box, invalidationReason); |
1515 } | 1501 } |
1516 | 1502 |
1517 // TODO(lunalu): Not to just dump 0, 0 as the x and y here | 1503 // TODO(lunalu): Not to just dump 0, 0 as the x and y here |
1518 LayoutRect LayoutInline::debugRect() const { | 1504 LayoutRect LayoutInline::debugRect() const { |
1519 IntRect linesBox = enclosingIntRect(linesBoundingBox()); | 1505 IntRect linesBox = enclosingIntRect(linesBoundingBox()); |
1520 return LayoutRect(IntRect(0, 0, linesBox.width(), linesBox.height())); | 1506 return LayoutRect(IntRect(0, 0, linesBox.width(), linesBox.height())); |
1521 } | 1507 } |
1522 | 1508 |
1523 } // namespace blink | 1509 } // namespace blink |
OLD | NEW |