mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
-Add RenderParagraph and display:paragraph. This is the only render type that's allowed to contain inlines or text. -If you put text nodes directly in a non-paragraph, wrap them in an anonymous paragraph. This may not be the place we want to end up, but it's a good stopgap to make it so we don't crash in this case. -Make StyleAdjuster force that non-paragraph blocks only contain RenderBlock subclasses and that paragraphs and inlines only contain inlines. -Considerably simplify addChildIgnoringAnonymousColumnBlocks now that we only create anonymous blocks for the case of text nodes in non-paragraphs. Also get rid of the behavior where we try to group multiple nodes into a single anonymous block. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/729693003
30 lines
727 B
C++
30 lines
727 B
C++
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef RenderParagraph_h
|
|
#define RenderParagraph_h
|
|
|
|
#include "core/dom/ContainerNode.h"
|
|
#include "core/rendering/RenderBlockFlow.h"
|
|
|
|
namespace blink {
|
|
|
|
class ContainerNode;
|
|
|
|
class RenderParagraph final : public RenderBlockFlow {
|
|
public:
|
|
explicit RenderParagraph(ContainerNode*);
|
|
virtual ~RenderParagraph();
|
|
|
|
static RenderParagraph* createAnonymous(Document&);
|
|
|
|
bool isRenderParagraph() const override { return true; }
|
|
};
|
|
|
|
DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderParagraph, isRenderParagraph());
|
|
|
|
} // namespace blink
|
|
|
|
#endif // RenderParagraph_h
|