tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

CSSFontFeatureValuesRule.cpp (2516B)


      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 #include "mozilla/dom/CSSFontFeatureValuesRule.h"
      8 
      9 #include "mozilla/ServoBindings.h"
     10 #include "mozilla/dom/CSSFontFeatureValuesRuleBinding.h"
     11 
     12 namespace mozilla::dom {
     13 
     14 size_t CSSFontFeatureValuesRule::SizeOfIncludingThis(
     15    MallocSizeOf aMallocSizeOf) const {
     16  // TODO Implement this!
     17  return aMallocSizeOf(this);
     18 }
     19 
     20 StyleCssRuleType CSSFontFeatureValuesRule::Type() const {
     21  return StyleCssRuleType::FontFeatureValues;
     22 }
     23 
     24 #ifdef DEBUG
     25 void CSSFontFeatureValuesRule::List(FILE* out, int32_t aIndent) const {
     26  nsAutoCString str;
     27  for (int32_t i = 0; i < aIndent; i++) {
     28    str.AppendLiteral("  ");
     29  }
     30  Servo_FontFeatureValuesRule_Debug(mRawRule, &str);
     31  fprintf_stderr(out, "%s\n", str.get());
     32 }
     33 #endif
     34 
     35 void CSSFontFeatureValuesRule::SetRawAfterClone(
     36    RefPtr<StyleFontFeatureValuesRule> aRaw) {
     37  mRawRule = std::move(aRaw);
     38 }
     39 
     40 /* CSSRule implementation */
     41 
     42 void CSSFontFeatureValuesRule::GetCssText(nsACString& aCssText) const {
     43  Servo_FontFeatureValuesRule_GetCssText(mRawRule, &aCssText);
     44 }
     45 
     46 /* CSSFontFeatureValuesRule implementation */
     47 
     48 void CSSFontFeatureValuesRule::GetFontFamily(nsACString& aFamilyListStr) {
     49  Servo_FontFeatureValuesRule_GetFontFamily(mRawRule, &aFamilyListStr);
     50 }
     51 
     52 void CSSFontFeatureValuesRule::GetValueText(nsACString& aValueText) {
     53  Servo_FontFeatureValuesRule_GetValueText(mRawRule, &aValueText);
     54 }
     55 
     56 void CSSFontFeatureValuesRule::SetFontFamily(const nsACString& aFontFamily,
     57                                             ErrorResult& aRv) {
     58  if (IsReadOnly()) {
     59    return;
     60  }
     61 
     62  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
     63 }
     64 
     65 void CSSFontFeatureValuesRule::SetValueText(const nsACString& aValueText,
     66                                            ErrorResult& aRv) {
     67  if (IsReadOnly()) {
     68    return;
     69  }
     70 
     71  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
     72 }
     73 
     74 // If this ever gets its own cycle-collection bits, reevaluate our IsCCLeaf
     75 // implementation.
     76 
     77 bool CSSFontFeatureValuesRule::IsCCLeaf() const { return Rule::IsCCLeaf(); }
     78 
     79 /* virtual */
     80 JSObject* CSSFontFeatureValuesRule::WrapObject(
     81    JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
     82  return CSSFontFeatureValuesRule_Binding::Wrap(aCx, this, aGivenProto);
     83 }
     84 
     85 }  // namespace mozilla::dom