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

Unified Diff: Source/core/rendering/RenderTextControlPlaceholder.h

Issue 129873004: RenderBlock::isSelfCollapsingBlock() should only be used when an object does not require layout. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderTextControlPlaceholder.h
diff --git a/Source/core/rendering/RenderTableCaption.h b/Source/core/rendering/RenderTextControlPlaceholder.h
similarity index 51%
copy from Source/core/rendering/RenderTableCaption.h
copy to Source/core/rendering/RenderTextControlPlaceholder.h
index 35755a9d03b26632206ecc341a7ff7cb53b11a12..58ddba81c543bf88e7f4544add9ab8f36ecdb9e4 100644
--- a/Source/core/rendering/RenderTableCaption.h
+++ b/Source/core/rendering/RenderTextControlPlaceholder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Robert Hogan <robert@roberthogan.net>
+ * Copyright (C) 2014 Robert Hogan <robert@roberthogan.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -17,34 +17,26 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef RenderTableCaption_h
-#define RenderTableCaption_h
+#ifndef RenderTextControlPlaceholder_h
+#define RenderTextControlPlaceholder_h
#include "core/rendering/RenderBlockFlow.h"
namespace WebCore {
-class RenderTable;
-class RenderTableCaption FINAL : public RenderBlockFlow {
+class RenderTextControlPlaceholder FINAL : public RenderBlockFlow {
public:
- explicit RenderTableCaption(Element*);
- virtual ~RenderTableCaption();
- virtual LayoutUnit containingBlockLogicalWidthForContent() const OVERRIDE;
-
-private:
- virtual bool isTableCaption() const OVERRIDE { return true; }
-
- virtual bool supportsPartialLayout() const OVERRIDE { return false; }
-
- virtual void insertedIntoTree() OVERRIDE;
- virtual void willBeRemovedFromTree() OVERRIDE;
-
- RenderTable* table() const;
+ explicit RenderTextControlPlaceholder(Element*);
+ virtual ~RenderTextControlPlaceholder();
+
+ // Placeholder elements are not laid out until the dimensions of their parent text control are known,
+ // so they don't get layout until their parent has had layout. This is a problem when we have iterated
+ // a parent's children and want to call isSelfCollapsingBlock. Fortunately since placeholder elements
+ // only exist when they have content we can always enforce the rule that they are never self-collapsing.
+ virtual bool isSelfCollapsingBlock() const OVERRIDE FINAL { return false; }
};
-DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderTableCaption, isTableCaption());
-
} // namespace WebCore
-#endif // RenderTableCaption_h
+#endif // RenderTextControlPlaceholder_h

Powered by Google App Engine
This is Rietveld 408576698