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) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 { | 1278 { |
1279 BlockPainter(*this).paintObject(paintInfo, paintOffset); | 1279 BlockPainter(*this).paintObject(paintInfo, paintOffset); |
1280 } | 1280 } |
1281 | 1281 |
1282 LayoutInline* LayoutBlock::inlineElementContinuation() const | 1282 LayoutInline* LayoutBlock::inlineElementContinuation() const |
1283 { | 1283 { |
1284 LayoutBoxModelObject* continuation = this->continuation(); | 1284 LayoutBoxModelObject* continuation = this->continuation(); |
1285 return continuation && continuation->isInline() ? toLayoutInline(continuatio
n) : 0; | 1285 return continuation && continuation->isInline() ? toLayoutInline(continuatio
n) : 0; |
1286 } | 1286 } |
1287 | 1287 |
1288 ContinuationOutlineTableMap* continuationOutlineTable() | |
1289 { | |
1290 DEFINE_STATIC_LOCAL(ContinuationOutlineTableMap, table, ()); | |
1291 return &table; | |
1292 } | |
1293 | |
1294 void LayoutBlock::addContinuationWithOutline(LayoutInline* flow) | |
1295 { | |
1296 // We can't make this work if the inline is in a layer. We'll just rely on
the broken | |
1297 // way of painting. | |
1298 ASSERT(!flow->layer() && !flow->isInlineElementContinuation()); | |
1299 | |
1300 ContinuationOutlineTableMap* table = continuationOutlineTable(); | |
1301 ListHashSet<LayoutInline*>* continuations = table->get(this); | |
1302 if (!continuations) { | |
1303 continuations = new ListHashSet<LayoutInline*>; | |
1304 table->set(this, adoptPtr(continuations)); | |
1305 } | |
1306 | |
1307 continuations->add(flow); | |
1308 } | |
1309 | |
1310 bool LayoutBlock::isSelectionRoot() const | 1288 bool LayoutBlock::isSelectionRoot() const |
1311 { | 1289 { |
1312 if (isPseudoElement()) | 1290 if (isPseudoElement()) |
1313 return false; | 1291 return false; |
1314 ASSERT(node() || isAnonymous()); | 1292 ASSERT(node() || isAnonymous()); |
1315 | 1293 |
1316 // FIXME: Eventually tables should have to learn how to fill gaps between ce
lls, at least in simple non-spanning cases. | 1294 // FIXME: Eventually tables should have to learn how to fill gaps between ce
lls, at least in simple non-spanning cases. |
1317 if (isTable()) | 1295 if (isTable()) |
1318 return false; | 1296 return false; |
1319 | 1297 |
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2879 | 2857 |
2880 if (TrackedLayoutBoxListHashSet* positionedDescendantSet = positionedObjects
()) { | 2858 if (TrackedLayoutBoxListHashSet* positionedDescendantSet = positionedObjects
()) { |
2881 TrackedLayoutBoxListHashSet::const_iterator end = positionedDescendantSe
t->end(); | 2859 TrackedLayoutBoxListHashSet::const_iterator end = positionedDescendantSe
t->end(); |
2882 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda
ntSet->begin(); it != end; ++it) { | 2860 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda
ntSet->begin(); it != end; ++it) { |
2883 LayoutBox* currBox = *it; | 2861 LayoutBox* currBox = *it; |
2884 ASSERT(!currBox->needsLayout()); | 2862 ASSERT(!currBox->needsLayout()); |
2885 } | 2863 } |
2886 } | 2864 } |
2887 } | 2865 } |
2888 | 2866 |
2889 bool LayoutBlock::paintsContinuationOutline(LayoutInline* flow) | |
2890 { | |
2891 ContinuationOutlineTableMap* table = continuationOutlineTable(); | |
2892 if (table->isEmpty()) | |
2893 return false; | |
2894 | |
2895 ListHashSet<LayoutInline*>* continuations = table->get(this); | |
2896 if (!continuations) | |
2897 return false; | |
2898 | |
2899 return continuations->contains(flow); | |
2900 } | |
2901 | |
2902 #endif | 2867 #endif |
2903 | 2868 |
2904 #ifndef NDEBUG | 2869 #ifndef NDEBUG |
2905 | 2870 |
2906 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const | 2871 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const |
2907 { | 2872 { |
2908 showLayoutObject(); | 2873 showLayoutObject(); |
2909 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 2874 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
2910 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 2875 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
2911 } | 2876 } |
2912 | 2877 |
2913 #endif | 2878 #endif |
2914 | 2879 |
2915 } // namespace blink | 2880 } // namespace blink |
OLD | NEW |