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

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

Issue 2667493002: Changed EPosition to an enum class and renamed its members (Closed)
Patch Set: Rebase Created 3 years, 10 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
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 4299 matching lines...) Expand 10 before | Expand all | Expand 10 after
4310 4310
4311 m_rareData = WTF::makeUnique<LayoutBlockFlowRareData>(this); 4311 m_rareData = WTF::makeUnique<LayoutBlockFlowRareData>(this);
4312 return *m_rareData; 4312 return *m_rareData;
4313 } 4313 }
4314 4314
4315 void LayoutBlockFlow::positionDialog() { 4315 void LayoutBlockFlow::positionDialog() {
4316 HTMLDialogElement* dialog = toHTMLDialogElement(node()); 4316 HTMLDialogElement* dialog = toHTMLDialogElement(node());
4317 if (dialog->getCenteringMode() == HTMLDialogElement::NotCentered) 4317 if (dialog->getCenteringMode() == HTMLDialogElement::NotCentered)
4318 return; 4318 return;
4319 4319
4320 bool canCenterDialog = (style()->position() == AbsolutePosition || 4320 bool canCenterDialog = (style()->position() == EPosition::kAbsolute ||
4321 style()->position() == FixedPosition) && 4321 style()->position() == EPosition::kFixed) &&
4322 style()->hasAutoTopAndBottom(); 4322 style()->hasAutoTopAndBottom();
4323 4323
4324 if (dialog->getCenteringMode() == HTMLDialogElement::Centered) { 4324 if (dialog->getCenteringMode() == HTMLDialogElement::Centered) {
4325 if (canCenterDialog) 4325 if (canCenterDialog)
4326 setY(dialog->centeredPosition()); 4326 setY(dialog->centeredPosition());
4327 return; 4327 return;
4328 } 4328 }
4329 4329
4330 ASSERT(dialog->getCenteringMode() == HTMLDialogElement::NeedsCentering); 4330 ASSERT(dialog->getCenteringMode() == HTMLDialogElement::NeedsCentering);
4331 if (!canCenterDialog) { 4331 if (!canCenterDialog) {
4332 dialog->setNotCentered(); 4332 dialog->setNotCentered();
4333 return; 4333 return;
4334 } 4334 }
4335 4335
4336 FrameView* frameView = document().view(); 4336 FrameView* frameView = document().view();
4337 LayoutUnit top = LayoutUnit((style()->position() == FixedPosition) 4337 LayoutUnit top = LayoutUnit((style()->position() == EPosition::kFixed)
4338 ? 0 4338 ? 0
4339 : frameView->scrollOffsetInt().height()); 4339 : frameView->scrollOffsetInt().height());
4340 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(); 4340 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height();
4341 if (size().height() < visibleHeight) 4341 if (size().height() < visibleHeight)
4342 top += (visibleHeight - size().height()) / 2; 4342 top += (visibleHeight - size().height()) / 2;
4343 setY(top); 4343 setY(top);
4344 dialog->setCentered(top); 4344 dialog->setCentered(top);
4345 } 4345 }
4346 4346
4347 void LayoutBlockFlow::simplifiedNormalFlowInlineLayout() { 4347 void LayoutBlockFlow::simplifiedNormalFlowInlineLayout() {
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
4605 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); 4605 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState);
4606 } 4606 }
4607 4607
4608 void LayoutBlockFlow::invalidateDisplayItemClients( 4608 void LayoutBlockFlow::invalidateDisplayItemClients(
4609 PaintInvalidationReason invalidationReason) const { 4609 PaintInvalidationReason invalidationReason) const {
4610 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( 4610 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(
4611 invalidationReason); 4611 invalidationReason);
4612 } 4612 }
4613 4613
4614 } // namespace blink 4614 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698