[go: up one dir, main page]

Allocate memory for borders and padding members of NGPhysicalBoxFragment if needed

This patch changes memory layout of |NGPhysicalBoxFragment| based on value of
borders and padding as
 - No borders and no padding
  |NGPhysicalBoxFragment|, children[]
 - having both borders no padding
  |NGPhysicalBoxFragment|, children[], borders, padding
 - borders and no padding
  |NGPhysicalBoxFragment|, children[], borders
 - no borders and padding
  |NGPhysicalBoxFragment|, children[], padding
for reducing memory usage, since borders and padding are frequently zero.

(cherry picked from commit 8318aa75176654769ece376cd71fd9fc5deef823)

TBR=yosin@chromium.org

Bug: 962108
Change-Id: I215f6570b9982745609546bcfef5fc3ef0cf5186
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1663554
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/branch-heads/3809@{#397}
Cr-Branched-From: d82dec1a818f378c464ba307ddd9c92133eac355-refs/heads/master@{#665002}
4 files changed