element_foreignobject.erl 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. -module(element_foreignobject).
  2. -author('Konstantin Zakablukovsky').
  3. -include("nitro.hrl").
  4. -compile(export_all).
  5. render_element(Record) ->
  6. wf_tags:emit_tag(<<"foreignObject">>, nitro:render(Record#foreignObject.body),
  7. lists:append([
  8. [
  9. {<<"id">>, Record#foreignObject.id},
  10. {<<"class">>, Record#foreignObject.class},
  11. {<<"style">>, Record#foreignObject.style},
  12. {<<"x">>, Record#foreignObject.x},
  13. {<<"y">>, Record#foreignObject.y},
  14. {<<"width">>, Record#foreignObject.width},
  15. {<<"height">>, Record#foreignObject.height},
  16. {<<"transform">>, Record#foreignObject.transform},
  17. {<<"externalResourcesRequired">>, Record#foreignObject.externalResourcesRequired}
  18. ],
  19. svg_conditional_processing(Record),
  20. svg_core(Record),
  21. svg_graphical_event(Record),
  22. svg_presentation(Record),
  23. Record#foreignObject.data_fields,
  24. Record#foreignObject.aria_states
  25. ])).
  26. %% Common SVG attributes
  27. svg_conditional_processing(Record)-> [
  28. {<<"requiredExtensions">>, Record#foreignObject.requiredExtensions},
  29. {<<"requiredFeatures">>, Record#foreignObject.requiredFeatures},
  30. {<<"systemLanguage">>, Record#foreignObject.systemLanguage}
  31. ].
  32. svg_core(Record)-> [
  33. {<<"xml:base">>, Record#foreignObject.xmlbase},
  34. {<<"xml:lang">>, Record#foreignObject.xmllang},
  35. {<<"xml:space">>, Record#foreignObject.xmlspace}
  36. ].
  37. svg_graphical_event(Record)-> [
  38. {<<"onactivate">>, Record#foreignObject.onactivate},
  39. {<<"onclick">>, Record#foreignObject.onclick},
  40. {<<"onfocusin">>, Record#foreignObject.onfocusin},
  41. {<<"onfocusout">>, Record#foreignObject.onfocusout},
  42. {<<"onload">>, Record#foreignObject.onload_graphical},
  43. {<<"onmousedown">>, Record#foreignObject.onmousedown},
  44. {<<"onmousemove">>, Record#foreignObject.onmousemove},
  45. {<<"onmouseout">>, Record#foreignObject.onmouseout},
  46. {<<"onmouseover">>, Record#foreignObject.onmouseover},
  47. {<<"onmouseup">>, Record#foreignObject.onmouseup}
  48. ].
  49. svg_presentation(Record)-> [
  50. {<<"alignment-baseline">>, Record#foreignObject.alignment_baseline},
  51. {<<"baseline-shift">>, Record#foreignObject.baseline_shift},
  52. {<<"clip">>, Record#foreignObject.clip},
  53. {<<"clip-path">>, Record#foreignObject.clip_path},
  54. {<<"clip-rule">>, Record#foreignObject.clip_rule},
  55. {<<"color">>, Record#foreignObject.color},
  56. {<<"color-interpolation">>, Record#foreignObject.color_interpolation},
  57. {<<"color-interpolation-filters">>, Record#foreignObject.color_interpolation_filters},
  58. {<<"color-profile">>, Record#foreignObject.color_profile},
  59. {<<"color-rendering">>, Record#foreignObject.color_rendering},
  60. {<<"cursor">>, Record#foreignObject.cursor},
  61. {<<"direction">>, Record#foreignObject.direction},
  62. {<<"display">>, Record#foreignObject.display},
  63. {<<"dominant-baseline">>, Record#foreignObject.dominant_baseline},
  64. {<<"enable-background">>, Record#foreignObject.enable_background},
  65. {<<"fill">>, Record#foreignObject.fill},
  66. {<<"fill-opacity">>, Record#foreignObject.fill_opacity},
  67. {<<"fill-rule">>, Record#foreignObject.fill_rule},
  68. {<<"filter">>, Record#foreignObject.filter},
  69. {<<"flood-color">>, Record#foreignObject.flood_color},
  70. {<<"flood-opacity">>, Record#foreignObject.flood_opacity},
  71. {<<"font-family">>, Record#foreignObject.font_family},
  72. {<<"font-size">>, Record#foreignObject.font_size},
  73. {<<"font-size-adjust">>, Record#foreignObject.font_size_adjust},
  74. {<<"font-stretch">>, Record#foreignObject.font_stretch},
  75. {<<"font-style">>, Record#foreignObject.font_style},
  76. {<<"font-variant">>, Record#foreignObject.font_variant},
  77. {<<"font-weight">>, Record#foreignObject.font_weight},
  78. {<<"glyph-orientation-horizontal">>, Record#foreignObject.glyph_orientation_horizontal},
  79. {<<"glyph-orientation-vertical">>, Record#foreignObject.glyph_orientation_vertical},
  80. {<<"image-rendering">>, Record#foreignObject.image_rendering},
  81. {<<"kerning">>, Record#foreignObject.kerning},
  82. {<<"letter-spacing">>, Record#foreignObject.letter_spacing},
  83. {<<"lighting-color">>, Record#foreignObject.lighting_color},
  84. {<<"marker-end">>, Record#foreignObject.marker_end},
  85. {<<"marker-mid">>, Record#foreignObject.marker_mid},
  86. {<<"marker-start">>, Record#foreignObject.marker_start},
  87. {<<"mask">>, Record#foreignObject.mask},
  88. {<<"opacity">>, Record#foreignObject.opacity},
  89. {<<"overflow">>, Record#foreignObject.overflow},
  90. {<<"pointer-events">>, Record#foreignObject.pointer_events},
  91. {<<"shape-rendering">>, Record#foreignObject.shape_rendering},
  92. {<<"stop-color">>, Record#foreignObject.stop_color},
  93. {<<"stop-opacity">>, Record#foreignObject.stop_opacity},
  94. {<<"stroke">>, Record#foreignObject.stroke},
  95. {<<"stroke-dasharray">>, Record#foreignObject.stroke_dasharray},
  96. {<<"stroke-dashoffset">>, Record#foreignObject.stroke_dashoffset},
  97. {<<"stroke-linecap">>, Record#foreignObject.stroke_linecap},
  98. {<<"stroke-linejoin">>, Record#foreignObject.stroke_linejoin},
  99. {<<"stroke-miterlimit">>, Record#foreignObject.stroke_miterlimit},
  100. {<<"stroke-opacity">>, Record#foreignObject.stroke_opacity},
  101. {<<"stroke-width">>, Record#foreignObject.stroke_width},
  102. {<<"text-anchor">>, Record#foreignObject.text_anchor},
  103. {<<"text-decoration">>, Record#foreignObject.text_decoration},
  104. {<<"text-rendering">>, Record#foreignObject.text_rendering},
  105. {<<"unicode-bidi">>, Record#foreignObject.unicode_bidi},
  106. {<<"visibility">>, Record#foreignObject.visibility},
  107. {<<"word-spacing">>, Record#foreignObject.word_spacing},
  108. {<<"writing-mode">>, Record#foreignObject.writing_mode}
  109. ].