Commit 23b9e486 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

[LayoutNG] Make NonInlineBlockFlow() in ax_node_object.cc to use IsAtomicInlineLevel()

This patch makes file local funciton |NonInlineBlockFlow()| in
"ax_node_object.cc" to use |IsAtomicInlineLevel()| to make this funciton to
work both legacy layout and LayoutNG.

Note: |IsAtomicInlineLevel()| is a bitfiled in |LayoutObject|. It is set by
|LayoutBlock::StyleWillChange()| when compute style has "display:inline-block".

Therefore, in legacy layout, when |IsAtomicInlineLevel()| is true for
|LayoutBlockFlow|, |!InlineBoxWrapper() == !IsAtomicInlineLevel()|.


In LayoutNG, |IsAtomicInlineLevel()| is used for computing physical fragment
box type in |BoxTypeFromLayoutObject()|. |BoxTypeFromLayoutObject()| returns
|NGBoxyType::kAtomicInline| for |IsAtomicInlineLevel()|.

Bug: 591099
Change-Id: Ieafd8a414662df7e0d4f48f1b15657a602265559
Reviewed-on: https://chromium-review.googlesource.com/1092224Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566770}
parent 4d474821
...@@ -1690,14 +1690,13 @@ AccessibilityRole AXNodeObject::AriaRoleAttribute() const { ...@@ -1690,14 +1690,13 @@ AccessibilityRole AXNodeObject::AriaRoleAttribute() const {
return aria_role_; return aria_role_;
} }
// Returns the nearest LayoutBlockFlow ancestor which does not have an // Returns the nearest block-level LayoutBlockFlow ancestor
// inlineBoxWrapper - i.e. is not itself an inline object.
static LayoutBlockFlow* NonInlineBlockFlow(LayoutObject* object) { static LayoutBlockFlow* NonInlineBlockFlow(LayoutObject* object) {
LayoutObject* current = object; LayoutObject* current = object;
while (current) { while (current) {
if (current->IsLayoutBlockFlow()) { if (current->IsLayoutBlockFlow()) {
LayoutBlockFlow* block_flow = ToLayoutBlockFlow(current); LayoutBlockFlow* block_flow = ToLayoutBlockFlow(current);
if (!block_flow->InlineBoxWrapper()) if (!block_flow->IsAtomicInlineLevel())
return block_flow; return block_flow;
} }
current = current->Parent(); current = current->Parent();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment