nsRubyContentFrame.cpp (1045B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 /* base class for ruby rendering objects that directly contain content */ 8 9 #include "nsRubyContentFrame.h" 10 11 #include "mozilla/ComputedStyle.h" 12 #include "nsCSSAnonBoxes.h" 13 #include "nsPresContext.h" 14 15 using namespace mozilla; 16 17 //---------------------------------------------------------------------- 18 19 // nsRubyContentFrame Method Implementations 20 // ====================================== 21 22 bool nsRubyContentFrame::IsIntraLevelWhitespace() const { 23 auto pseudoType = Style()->GetPseudoType(); 24 if (pseudoType != PseudoStyleType::rubyBase && 25 pseudoType != PseudoStyleType::rubyText) { 26 return false; 27 } 28 29 nsIFrame* child = mFrames.OnlyChild(); 30 return child && child->GetContent()->TextIsOnlyWhitespace(); 31 }