2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2017-10-27 20:09:35 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2015-01-08 10:28:09 +03:00
|
|
|
|
|
|
|
/* base class for ruby rendering objects that directly contain content */
|
|
|
|
|
|
|
|
#include "nsRubyContentFrame.h"
|
2018-03-22 21:20:41 +03:00
|
|
|
|
|
|
|
#include "mozilla/ComputedStyle.h"
|
2015-01-08 10:28:09 +03:00
|
|
|
#include "nsPresContext.h"
|
2015-01-08 10:28:09 +03:00
|
|
|
#include "nsCSSAnonBoxes.h"
|
2015-01-08 10:28:09 +03:00
|
|
|
|
|
|
|
using namespace mozilla;
|
|
|
|
|
2015-10-20 02:21:44 +03:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
// nsRubyContentFrame Method Implementations
|
|
|
|
// ======================================
|
|
|
|
|
2019-02-26 01:09:24 +03:00
|
|
|
/* virtual */
|
|
|
|
bool nsRubyContentFrame::IsFrameOfType(uint32_t aFlags) const {
|
2015-01-08 10:28:09 +03:00
|
|
|
if (aFlags & eBidiInlineContainer) {
|
|
|
|
return false;
|
|
|
|
}
|
2016-04-18 09:06:23 +03:00
|
|
|
return nsInlineFrame::IsFrameOfType(aFlags);
|
2015-01-08 10:28:09 +03:00
|
|
|
}
|
2015-01-08 10:28:09 +03:00
|
|
|
|
|
|
|
bool nsRubyContentFrame::IsIntraLevelWhitespace() const {
|
2019-02-19 16:44:33 +03:00
|
|
|
auto pseudoType = Style()->GetPseudoType();
|
|
|
|
if (pseudoType != PseudoStyleType::rubyBase &&
|
|
|
|
pseudoType != PseudoStyleType::rubyText) {
|
2015-01-08 10:28:09 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIFrame* child = mFrames.OnlyChild();
|
|
|
|
return child && child->GetContent()->TextIsOnlyWhitespace();
|
|
|
|
}
|