Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Issue 2733173002: Demonstrates use after free (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "core/layout/line/InlineIterator.h" 47 #include "core/layout/line/InlineIterator.h"
48 #include "core/layout/line/InlineTextBox.h" 48 #include "core/layout/line/InlineTextBox.h"
49 #include "core/layout/line/LineWidth.h" 49 #include "core/layout/line/LineWidth.h"
50 #include "core/layout/shapes/ShapeOutsideInfo.h" 50 #include "core/layout/shapes/ShapeOutsideInfo.h"
51 #include "core/paint/BlockFlowPaintInvalidator.h" 51 #include "core/paint/BlockFlowPaintInvalidator.h"
52 #include "core/paint/PaintLayer.h" 52 #include "core/paint/PaintLayer.h"
53 #include "platform/RuntimeEnabledFeatures.h" 53 #include "platform/RuntimeEnabledFeatures.h"
54 #include "wtf/PtrUtil.h" 54 #include "wtf/PtrUtil.h"
55 #include <memory> 55 #include <memory>
56 56
57 #include <iostream>
58
57 namespace blink { 59 namespace blink {
58 60
59 bool LayoutBlockFlow::s_canPropagateFloatIntoSibling = false; 61 bool LayoutBlockFlow::s_canPropagateFloatIntoSibling = false;
60 62
61 struct SameSizeAsLayoutBlockFlow : public LayoutBlock { 63 struct SameSizeAsLayoutBlockFlow : public LayoutBlock {
62 LineBoxList lineBoxes; 64 LineBoxList lineBoxes;
63 void* pointers[2]; 65 void* pointers[2];
64 }; 66 };
65 67
66 static_assert(sizeof(LayoutBlockFlow) == sizeof(SameSizeAsLayoutBlockFlow), 68 static_assert(sizeof(LayoutBlockFlow) == sizeof(SameSizeAsLayoutBlockFlow),
(...skipping 3816 matching lines...) Expand 10 before | Expand all | Expand 10 after
3883 shouldPaint = true; 3885 shouldPaint = true;
3884 } 3886 }
3885 // We create the floating object list lazily. 3887 // We create the floating object list lazily.
3886 if (!m_floatingObjects) 3888 if (!m_floatingObjects)
3887 createFloatingObjects(); 3889 createFloatingObjects();
3888 3890
3889 m_floatingObjects->add( 3891 m_floatingObjects->add(
3890 floatingObject.copyToNewContainer(offset, shouldPaint, true)); 3892 floatingObject.copyToNewContainer(offset, shouldPaint, true));
3891 } 3893 }
3892 } else { 3894 } else {
3895 std::cout << "floating object test: " << floatingObject.layoutObject() << std::endl;
3896 std::cout << "This call to hasLayer causes use after free: " << floatingOb ject.layoutObject()->hasLayer() << std::endl;
3893 if (makeChildPaintOtherFloats && !floatingObject.shouldPaint() && 3897 if (makeChildPaintOtherFloats && !floatingObject.shouldPaint() &&
3894 !floatingObject.layoutObject()->hasSelfPaintingLayer() && 3898 !floatingObject.layoutObject()->hasSelfPaintingLayer() &&
3895 !floatingObject.isLowestNonOverhangingFloatInChild() && 3899 !floatingObject.isLowestNonOverhangingFloatInChild() &&
3896 floatingObject.layoutObject()->isDescendantOf(child) && 3900 floatingObject.layoutObject()->isDescendantOf(child) &&
3897 floatingObject.layoutObject()->enclosingFloatPaintingLayer() == 3901 floatingObject.layoutObject()->enclosingFloatPaintingLayer() ==
3898 child->enclosingFloatPaintingLayer()) { 3902 child->enclosingFloatPaintingLayer()) {
3899 // The float is not overhanging from this block, so if it is a 3903 // The float is not overhanging from this block, so if it is a
3900 // descendant of the child, the child should paint it (the other case is 3904 // descendant of the child, the child should paint it (the other case is
3901 // that it is intruding into the child), unless it has its own layer or 3905 // that it is intruding into the child), unless it has its own layer or
3902 // enclosing layer. 3906 // enclosing layer.
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
4605 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); 4609 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState);
4606 } 4610 }
4607 4611
4608 void LayoutBlockFlow::invalidateDisplayItemClients( 4612 void LayoutBlockFlow::invalidateDisplayItemClients(
4609 PaintInvalidationReason invalidationReason) const { 4613 PaintInvalidationReason invalidationReason) const {
4610 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( 4614 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(
4611 invalidationReason); 4615 invalidationReason);
4612 } 4616 }
4613 4617
4614 } // namespace blink 4618 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698